Dear Statalisters,
I am preparing several combined graphs for my clients (details are confidential) using the grc1leg user-made command, to have a single legend. See below a simple example from the auto dataset:
and the output is in the first reply.
The problem, as you can see from the resulting graph, is that it may happen that neither of the subgraphs contain all the categories (in this case, foreign and domestic) so, given that grc1leg forces me to choose between the legends of one of the subgraphs, the overall legend will necessarily be incomplete.
Is there a way around this? I am aware of the existence of undocumented graph editing command such as gr_edit, but I wouldn't know how to use them to specify a new legend from scratch.
Thank you in advance,
Fede
I am preparing several combined graphs for my clients (details are confidential) using the grc1leg user-made command, to have a single legend. See below a simple example from the auto dataset:
Code:
net install grc1leg, from(http://www.stata.com/users/vwiggins/) sysuse auto, clear tw (sc price rep78 if foreign), legend(order(1 "Price by rep78 if foreign")) name(g1, replace) tw (sc price displacement if !foreign, color(red)), legend(order(1 "Price by displacement if domestic")) name(g2, replace) grc1leg g1 g2, legendfrom(g1)
The problem, as you can see from the resulting graph, is that it may happen that neither of the subgraphs contain all the categories (in this case, foreign and domestic) so, given that grc1leg forces me to choose between the legends of one of the subgraphs, the overall legend will necessarily be incomplete.
Is there a way around this? I am aware of the existence of undocumented graph editing command such as gr_edit, but I wouldn't know how to use them to specify a new legend from scratch.
Thank you in advance,
Fede
Comment