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

Adding/Removing the Node/Edge legends individually. #202

Closed
grabear opened this issue Jan 19, 2018 · 3 comments
Closed

Adding/Removing the Node/Edge legends individually. #202

grabear opened this issue Jan 19, 2018 · 3 comments

Comments

@grabear
Copy link
Collaborator

grabear commented Jan 19, 2018

An option like make_legend = FALSE could exist for the edge legend and for the node legend separately.
Currently, the make_legend parameter controls both. In some cases you might only want one or the other. This might help save space in reference to file size and the plot dimensions.

So in the heat_tree function, there could be a make_node_legend parameter and a make_edge_legend parameter.

I know that implementing this might span across several scripts. If you could point me in the right direction, I would be happy to add this.

zachary-foster added a commit that referenced this issue Jan 22, 2018
@zachary-foster
Copy link
Contributor

Hello @grabear, thanks for the suggestion and offer to help!

This was a pretty easy change, so I just when ahead and did it.

Install the dev versions and try:

devtools::install_github("ropensci/taxa")
devtools::install_github("grunwaldlab/metacoder")

x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
                                class_key = c(tax_rank = "info", tax_name = "taxon_name"),
                                class_regex = "^(.+)__(.+)$")

heat_tree(x, node_label = taxon_names, node_size = n_obs, node_color = n_obs, edge_size = n_obs + 1)
heat_tree(x, node_label = taxon_names, node_size = n_obs, node_color = n_obs, edge_size = n_obs + 1, make_node_legend = FALSE)
heat_tree(x, node_label = taxon_names, node_size = n_obs, node_color = n_obs, edge_size = n_obs + 1, make_edge_legend = FALSE)
heat_tree(x, node_label = taxon_names, node_size = n_obs, node_color = n_obs, edge_size = n_obs + 1, make_edge_legend = FALSE, make_node_legend = FALSE)

@grabear
Copy link
Collaborator Author

grabear commented Jan 22, 2018

No problem! This package is awesome, so I'm excited to contribute once I finish the project I'm working on with metacoder. Nice update!

@zachary-foster
Copy link
Contributor

Thanks!

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

No branches or pull requests

2 participants