Removing legend

14 views
Skip to first unread message

michael...@gmail.com

unread,
Apr 30, 2019, 11:27:53 AM4/30/19
to metacoder
Is there a way to remove the legend from a graph?

I am combining multiple graphs that I have created using heat_tree with gridExtra::grid.arrange. All have the interval specified so that the legend is the same, I would just like to remove it from all but one graph.

Thanks.

-Michael

Zachary Foster

unread,
Apr 30, 2019, 11:49:06 AM4/30/19
to metacoder
Hi Michael,

You can use "make_node_legend = FALSE" and "make_edge_legend = FALSE".

One issue you might run into is that the plots without a legend are slightly bigger than those with one since the plots will expand to fit the plotted area. I dont have a good solution to this at the moment. You can either scale the non-legend plots to be a bit bigger or leave the legend on all of them and remove all but one manually in inkscape/photoshop in a pdf output.

I hope that helps. I would like to make a function for multiple plots to make this kind of thing easier. 

Best,

Zach
Reply all
Reply to author
Forward
0 new messages