Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: graph combine with (non-standard) one legend


From   <[email protected]>
To   <[email protected]>
Subject   st: graph combine with (non-standard) one legend
Date   Fri, 14 Jun 2013 14:08:08 +0100

A colleague asked me the following:

"I've got 3 Stata graphs which will all have the same legend. I'd like
to display them in a 2x2 array, with the graphs in 3 of the cells and
the legend on its own in the fourth. Does anyone know if it's possible
to do this - and, if so, how?"

My response:

*------------------------------------
sysuse auto

* graph with a legend 

tw (scatter headroom weight)(scatter price weight), saving(junk4,
replace)

* -findit grc1leg-, and install it. "graph combine one legend" 

grc1leg junk4.gph junk4.gph junk4.gph, row(2) legendfrom(junk4.gph)
position(3) ring(0)

* gets you most of the way?  Could then move legend down using Graph
Editor?

*------------------------------------

I also commented:

One strategy might be to

(a) do the 3 graphs with "legend(off)"
(b) add a fourth graph that is a version of one of the others, except
that you add options that: ask for no plotting of axes; all plot
elements invisible (depends on graph type); use legend location option
to put it in the middle.

Other things might be easier, depending on how complicated your legend
is.

*-----------------------------


Any suggestions about how to best achieve the questioner's goals,
preferably without Graph Editor intervention?

thanks
Stephen
------------------
Stephen P. Jenkins <[email protected]>

Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer

<<winmail.dat>>



© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index