Tuesday, March 14, 2006

Re: st: legend on graph help

Uli wrote:

I agree with most of the things Svend said, however, regarding the || notation I recently changed my mind. I meanwhile write commands like the above as follows:

twoway /// || line mpg price if fore == 0 , sort lc(blue) lp(dash) /// || line mpg price if fore == 1 , sort lc(black) /// || , legend(order(1 "white sex ratio" 2 "black sex ratio")

Note that I use || to start the plots instead of ending them as it is proposed in the manual. I admitt that the first mention of || is not necessary but I think that it makes the command at least as transparent as with the () notation. Moreover I think it is even nicer with longer plot-subcommands:

twoway /// || line mpg price /// if fore == 0 & whatever you like /// , sort lc(blue) lp(dash) bla bla bla bal bal /// || line mpg price /// if fore == 1 & some other exp /// , sort lc(black) etc etc etc etc /// || , legend(order(1 "white sex ratio" 2 "black sex ratio")

----------------------------------------------------------------------

Uli,

I think this is a very good and transparent style. I might change my mind, too.

Svend

________________________________________________________

Svend Juul Institut for Folkesundhed, Afdeling for Epidemiologi (Institute of Public Health, Department of Epidemiology) Vennelyst Boulevard 6 DK-8000 Aarhus C, Denmark Phone, work: +45 8942 6090 Phone, home: +45 8693 7796 Fax: +45 8613 1580 E-mail: sj@soci.au.dk _________________________________________________________

* * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/


Tag:


Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?