Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot_tree: Added ggplot code to fix ugly legend "a"s #1748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stephanbitterwolf
Copy link

When using plot_tree with tip labels and a color, the legend is altered and colored "a"s appear. I tried removing these after executing the plot_tree command but was not able to. Instead I needed to edit the plot_tree function itself to add "show.legend = FALSE" in the final section.

This removes the geom_text "a" from the legend.

This image shows the "a"s in the legend:
image

Here is what a similar tree looks like with "show.legend=FALSE" added for the tip labels:

image

p <- p + geom_text(labelMap, tiplabDT, size = I(text.size),
hjust = -0.1, na.rm = TRUE, show.legend = FALSE) #added show.legend=FALSE so that the legend does not show colored "a"s when using plot_tree.

p <- p + geom_text(labelMap, tiplabDT, size = I(text.size), 
            hjust = -0.1, na.rm = TRUE, show.legend = FALSE) #added show.legend=FALSE so that the legend does not show colored "a"s when using plot_tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant