Skip to content

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

Open
stephanbitterwolf wants to merge 1 commit intojoey711:masterfrom
stephanbitterwolf:patch-1
Open

plot_tree: Added ggplot code to fix ugly legend "a"s#1748
stephanbitterwolf wants to merge 1 commit intojoey711:masterfrom
stephanbitterwolf:patch-1

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