Statalist


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

Re: st: Ordering graphs when using by()


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Ordering graphs when using by()
Date   Sat, 11 Apr 2009 00:21:19 +0200

<>

Wait a minute! If you really go to such great lengths as to change the -var labels-, you could also replicate the -by()- thing with -levelsof- and then -gr combine- them.


****
sysuse auto, clear

*default with by()
*twoway (scatter mpg price), by(f, total rows(1))

qui levels for, local(mylev)
foreach lev of local mylev{
sc mpg pr if f==`lev', name(gr`lev', replace) nodraw title("`: label origin `lev''")
}
*get graph for total
sc mpg pr, name(grtot, replace) nodraw title("Total")

*default after by()
graph combine gr0 gr1 grtot, rows(1)
*want them ordered differently...
graph combine  grtot gr0 gr1, rows(1)
****

-findit grc1leg- could be handy then :-)

HTH
Martin
_______________________
----- Original Message ----- From: "Pamela Oliver" <pamelaoliver1180@gmail.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Saturday, April 11, 2009 12:05 AM
Subject: Re: st: Ordering graphs when using by()


I've added numbers to the beginnings of variable labels or string variables to get them to sort the way I want them to. I don't know of any more elegant solution.

Ricardo Ovaldia wrote:
I am using -twoway ,by( ,rows(1))- to output three graphs in one row. However the graphs are ordered alphabetically. Is there a way to specify or change the order within the row?
Thank you,
Mario.

Ricardo Ovaldia, MS
Statistician Oklahoma City, OK




      *
*   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/



*
*   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/


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index