<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Styling toytree drawings
The number of styling available in toytree is enormous and will continue to grow as development on the project continues. If you have a specific styling option that does not appear to be supported please raise a issue on GitHub and we can discuss adding support for it. Below I try to demonstrate the options and usage of each styling option with at least one example.
Step1:  Tip label styling
tip_labels
Type
Step2:  tip_labels_align
Type
Step3:  tip_labels_colors
Type
Step4:  tip_labels_style
Type
Step5:  Node labels styling
node_labels
Type
Step6:  node_labels_style
Type
Step7:  Node styling
node_sizes
Step8:  node_colors
Step9:  node_markers
See toyplot markers for available options.
Step10:  Rectangular markers can be drawn in many dimensions. Designate "r2x1" for a box that is twice as wide as it is tall.
Step11:  node_style
Step12:  node_hover
Enables interactive hover over nodes so that you can see all features associated with each.
Step13:  Layout
layout
Type
Step14:  todo
Type
Step15:  Styles
Step16:  Scalebar
You can add a scalebar to any tree plot by simply adding scalebar=True. Alternatively, you can add or customize axes by saving the returned variables from the .draw() function and modifying the axes.
<ASSISTANT_TASK:>
Python Code:
import toytree
import toyplot
import numpy as np
# a tree to use for examples
url = "https://eaton-lab.org/data/Cyathophora.tre"
rtre = toytree.tree(url).root(wildcard='prz')
Explanation: Styling toytree drawings
The number of styling available in toytree is enormous and will continue to grow as development on the project continues. If you have a specific styling option that does not appear to be supported please raise a issue on GitHub and we can discuss adding support for it. Below I try to demonstrate the options and usage of each styling option with at least one example.
End of explanation
# hide tip labels
rtre.draw(tip_labels=False);
# get tip labels from tree
tipnames = rtre.get_tip_labels()
# modify list so that html italic tags surround text
italicnames = ["<i>{}</i>".format(i) for i in tipnames]
# enter the list of names to tip_labels
rtre.draw(tip_labels=italicnames);
Explanation: Tip label styling
tip_labels
Type: boolean or list
Allowed: True, False, or list (length of ntips)
Default: True
Description: Shows or hides tip labels (boolean), or replaces tip labels with a user defined list.
End of explanation
rtre.draw(tip_labels_align=True);
Explanation: tip_labels_align
Type: boolean
Allowed: True, False
Default: False
Description: Add lines connecting tips to tip labels. See edge_align_style for ways to style the extra tip lines (colors, etc.).
End of explanation
# use color from favored toytree color scheme
rtre.draw(
    tip_labels_align=True, 
    tip_labels_colors=toytree.colors[1],
);
# enter a list of colors by name
rtre.draw(
    tip_labels_align=True, 
    tip_labels_colors=(['goldenrod'] * 11) + (["mediumseagreen"] * 2),
);
# make list of hex color values based on tip labels
colorlist = ["#d6557c" if "rex" in tip else "#5384a3" for tip in rtre.get_tip_labels()]
rtre.draw(
    tip_labels_align=True, 
    tip_labels_colors=colorlist
);
Explanation: tip_labels_colors
Type: (str, tuple, list)
Allowed: Any color values supported in toyplot colors. 
Default: "#262626" (near black)
Description: A single value can be applied to color all tip labels, or a list of values can be entered to apply different colors to different tip labels. The order of colors is applied to tip labels in the same order as .get_tip_labels() returns the labels. This order (the plot order) is from the tip located on the zero-axis (e.g., x=0 for right-facing trees) and continuing until the last name. If both tip_labels_colors and tip_labels_style["fill"] are used tip_labels_colors overrides the other. In contrast to the fill style, only this option can be used to apply multiple colors.
End of explanation
rtre.draw(
    tip_labels_style={
        "fill": "#262626", 
        "font-size": "11px", 
        "-toyplot-anchor-shift": "15px", 
    }
);
Explanation: tip_labels_style
Type: dictionary of (mostly) CSS styles.
Allowed: CSS styles accepted by toyplot. For example, you could add "stroke": "red" to draw a stroke around the text. The defaults provide just the most likely styles.
Default: Defaults are shown below.
Description: 'fill' is the color of the text; 'font-size' should be entered in units of pixels; '-toyplot-anchor-shift' can be used to shift text closer or farther from the tree tips.
End of explanation
# shows node idx labels on all nodes
rtre.draw(node_labels=True);
# suppreses nodes
rtre.draw(node_labels=False);
# suppresses node labels, sizes ensures nodes are still shown
rtre.draw(node_labels=False, node_sizes=10);
# shortcut for 'default' features always present in TreeNodes, suppresses tip nodes.
rtre.draw(node_labels="support");
# build a list of values in the correct node plot order
sups = rtre.get_node_values("support", show_root=True, show_tips=True)
rtre.draw(node_labels=sups);
Explanation: Node labels styling
node_labels
Type:  boolean, str, or list of strings or ints.
Allowed:  True, False, string name of features (e.g., "idx", "support"), or list that is the same length as the number of nodes. 
Default: False 
Description:  If True then the node index labels are used.
End of explanation
rtre.draw(
    node_labels='idx',
    node_labels_style={
        "fill": "#262626",
        "font-size": "8px",
    }
);
Explanation: node_labels_style
Type: dictionary.
Allowed: CSS values supported for text by toyplot.
Default: fill: near-black, font-size: '11px'. 
Description: A dictionary of CSS style options applied to text of node labels.
End of explanation
rtre.draw(
    node_labels=False,
    node_sizes=10,
);
# draw random values to use for node sizes
np.random.seed(1234)
sizes = np.random.uniform(5, 15, rtre.nnodes)
rtre.draw(
    node_labels=False,
    node_sizes=sizes,
);
Explanation: Node styling
node_sizes
End of explanation
# set a single color for all nodes
rtre.draw(
    node_labels=False,
    node_sizes=10, 
    node_colors=toytree.colors[1],
);
rtre.get_node_values("support", 1, 0)
# get list of sizes and colors in node plot order with tip nodes suppressed
sizes = [10 if i else 0 for i in rtre.get_node_values('support', 1, 0)]
colors = ['black' if i=='100' else 'red' for i in rtre.get_node_values('support', 1, 0)]
# enter a lists of values
rtre.draw(
    node_labels=None,
    node_sizes=sizes, 
    node_colors=colors,
);
Explanation: node_colors
End of explanation
# enter a lists of values
rtre.draw(
    node_labels="support",
    node_markers="o"
);
# enter a lists of values
rtre.draw(
    height=350,
    node_labels=None,
    node_sizes=[0 if i else 8 for i in rtre.get_node_values(None, 1, 0)],
    node_markers="s",
    node_colors=toytree.colors[1],
);
Explanation: node_markers
See toyplot markers for available options.
End of explanation
# rectangles for nodes
rtre.draw(
    width=600,
    height=400,
    node_labels="support",
    node_labels_style={"font-size": "11px"},
    node_markers="r2x1.25",
    node_sizes=12,
);
Explanation: Rectangular markers can be drawn in many dimensions. Designate "r2x1" for a box that is twice as wide as it is tall.
End of explanation
# the classic "ape" style tree plot look
rtre.draw(
    width=600,
    height=400,
    node_labels="support",
    node_labels_style={"font-size": "10px"},
    node_markers="r2x1.25",
    node_sizes=12,
    node_style={
        "fill": "lightgrey", 
        "stroke": "black",
        "stroke-width": 0.75,
    }
);
Explanation: node_style
End of explanation
rtre.draw(node_hover=True, node_labels=True, node_sizes=15);
Explanation: node_hover
Enables interactive hover over nodes so that you can see all features associated with each.
End of explanation
ttre = toytree.rtree.coaltree(20, seed=123)
ttre.draw(
    layout='d', 
    tip_labels_align=True,
    node_sizes=[8 if i else 0 for i in ttre.get_node_values()],
    node_style={"stroke": "black"},
    width=350,
    height=300,
);
ttre = toytree.rtree.unittree(40, seed=123)
ttre.draw(
    layout='c', 
    edge_type='c',
    node_sizes=[8 if i else 0 for i in ttre.get_node_values()],
    node_style={"stroke": "black"},
    width=400,
    height=400,
);
ttre = toytree.rtree.unittree(40, seed=123)
ttre.draw(
    layout='c', 
    edge_type='p',
    width=400,
    height=400,
);
Explanation: Layout
layout
Type:  str
Allowed: 'circular', 'c', 'right', 'r', 'down', 'd', (coming: 'unrooted', 'up', 'left')
Default: 'r'
Description:  The layout orients the direction of tip labels. Options include linear trees facing right, left, up, down, as well as circular and unrooted trees.
End of explanation
rtre.draw(
    tip_labels_align=True, 
    edge_align_style={
        "stroke": "violet",
        "stroke-width": 1.5,
        "stroke-dasharray": "2,5"    # size of dash, spacing of dashes
    });
Explanation: todo
Type:
Allowed:
Default:
Description:  
Aligned Edge Styling
edge_align_style
Type:
Allowed:
Default:
Description:
End of explanation
rtre.draw(tree_style='n');
# generate a random coalescent tree and draw in 'coalescent' style
randomtre = toytree.rtree.coaltree(ntips=10, seed=666)
randomtre.draw(tree_style='c');
Explanation: Styles
End of explanation
rtre.draw(scalebar=True);
Explanation: Scalebar
You can add a scalebar to any tree plot by simply adding scalebar=True. Alternatively, you can add or customize axes by saving the returned variables from the .draw() function and modifying the axes.
End of explanation
<END_TASK>