Statalist


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

Re: st: grc1leg


From   Gary Longton <[email protected]>
To   [email protected]
Subject   Re: st: grc1leg
Date   Mon, 01 Dec 2008 17:58:41 -0800

< >
an edit to my previous post - a better example:

  .sysuse auto, clear
  .scatter price weight, yaxis(1) ///
       || scatter mpg weight, yaxis(2)  name(g1, replace)
  .scatter price displacement, yaxis(1) ///
       || scatter mpg displacement, yaxis(2) name(g2, replace)
  .grc1leg g1 g2, name(g3, replace)
  .graph display g3, xsize(10) ysize(5)

The workaround is the same. The previous example, borrowed from the initial question, was a poor one. There was nothing common about the component graphs in either graph's legend.

- Gary

Gary Longton wrote:

Yes, I had run into the same problem in the past, but found a workaround.

It appears that the xsize() and ysize() region_options are unrecognized by -grc1leg- due to the use of -graph combine, nodraw `name'- and a subsequent -graph draw, `name'- in the .ado.

The workaround I used was to save the combined graph generated with -grc1leg- using the -,name()- option, then to redraw it with the -graph display- command, including the desired xsize() ysize() settings there.

  .sysuse auto, clear
  .scatter price mpg, name(g1, replace)
  .scatter weight length, name(g2, replace)
  .grc1leg g1 g2, name(g3, replace)
  .graph display g3, xsize(5) ysize(10)


- Gary


Chris Witte wrote:

I've ran into a problem using -grc1leg-, which puts a single legend on a combined graph. I am unable to use the -xsize- and -ysize- region options, which are available when using -graph combine-. here's an example:

sysuse auto, clear
scatter price mpg, name(g1)
scatter weight length, name(g2)
graph combine "C:\_DATA\g1" "C:\_DATA\g2", ysize(10)
grc1leg "C:\_DATA\g1" "C:\_DATA\g2", ysize(10)
can anyone fix this?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index