def nodeLayoutFunc(node):
                taxid = int(node.name)

                if taxid in taxidsToKeep:
                    taxGroupName = ncbiTaxa.get_taxid_translator(
                        [taxid]
                    )[taxid]  # There has to be an easier way to look up names...

                    row = None
                    rangeRows = None

                    print(len(ranges))

                    if (len(ranges) == 1):
                        row = df[(df['ExplanatoryVar'] == var)
                                 & (df['TaxGroup'] == taxid) &
                                 (df['Range'] == ranges[0])]
                        assert (len(row) == len(ranges))
                    elif len(ranges) > 1:
                        row = df[(df['ExplanatoryVar'] == var)
                                 & (df['TaxGroup'] == taxid) &
                                 (df['Range'] == 0)]
                        assert (len(row) == 1)
                        rangeRows = df[(df['ExplanatoryVar'] == var)
                                       & (df['TaxGroup'] == taxid) &
                                       (df['Range'].isin(set(ranges)))]
                    else:
                        assert (False)

                    overallPval = float(row['Pvalue'].values[0])

                    name = TextFace("%s" % taxGroupName,
                                    fsize=baseFontSize * 2.5)
                    name.tight_text = True
                    name.margin_left = 20
                    name.margin_right = 0
                    name.margin_top = 40
                    name.margin_bottom = 12
                    faces.add_face_to_node(name, node, column=0)

                    #print(rangeRows)

                    # For each range to be included in this plot, add a bar
                    for rangeId in ranges:
                        #print("rangeId = %s" % (rangeId))

                        rowForThisRange = None

                        if len(ranges) == 1:
                            rowForThisRange = row
                        else:
                            rowForThisRange = rangeRows[rangeRows['Range'] ==
                                                        rangeId]

                        assert (len(rowForThisRange) == 1)

                        # Extract p-value and "effect-size" (signed R^2)
                        effectSize = float(
                            rowForThisRange['EffectSize'].values[0])
                        pval = float(rowForThisRange['Pvalue'].values[0])

                        # Set bar-graph color and significance markers
                        barColor = ""
                        significanceMarker = ""
                        if (pval < significanceLevel):
                            significanceMarker = " %s" % unichr(0x2731)

                            if effectSize < 0:
                                barColor = "#1133ff"
                            else:
                                barColor = "#ff3311"
                        else:  # not significant
                            if effectSize < 0:
                                barColor = "#b0b0f0"
                            else:
                                barColor = "#ccb090"

                        # Add the minus sign if needed
                        signChar = ""
                        if effectSize < 0:
                            signChar = unichr(
                                0x2212
                            )  # minus sign (more legible than a hypen...)

                        v = RectFace(width=abs(effectSize) * barScale,
                                     height=baseFontSize * 3.5,
                                     fgcolor=barColor,
                                     bgcolor=barColor,
                                     label={
                                         "text":
                                         "%s%.2g %s" %
                                         (signChar, abs(effectSize),
                                          significanceMarker),
                                         "fontsize":
                                         baseFontSize * 1.8,
                                         "color":
                                         "black"
                                     })
                        #v.rotation = -90
                        v.margin_top = 1
                        v.margin_left = 30
                        v.margin_right = 8
                        v.margin_bottom = 12
                        faces.add_face_to_node(v, node, column=0)

                    details = TextFace(
                        "N=%d" % row['NumSpecies'], fsize=baseFontSize *
                        1.5)  #, fsize=baseFontSize) #, fstyle="italic")
                    details.background.color = "#dfdfdf"
                    details.margin_left = 6
                    details.margin_right = 20
                    #details.margin_top=5
                    #details.margin_bottom=0
                    faces.add_face_to_node(details, node, column=1)

                    nstyle = NodeStyle()
                    nstyle["size"] = 0

                    node.set_style(nstyle)