Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: legend on graph help


From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: legend on graph help
Date   Tue, 14 Mar 2006 20:36:57 +0100

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/



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