Created
October 29, 2015 12:07
-
-
Save terrycojones/4c34cff3fbb3e83192da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def draw(tree, label_func=str, do_show=True, show_confidence=True, | |
# For power users | |
axes=None, branch_labels=None, label_colors=None, | |
*args, **kwargs): | |
if label_colors: | |
if callable(label_colors): | |
def get_label_color(label): | |
return label_colors(label) | |
else: | |
# label_colors is presumed to be a dict | |
def get_label_color(label): | |
return label_colors.get(label, 'black') | |
else: | |
def get_label_color(label): | |
return 'black' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment