Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: variable color in Stata 8 plot


From   "FEIVESON, ALAN H. (AL) (JSC-SK) (NASA)" <alan.h.feiveson@nasa.gov>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: variable color in Stata 8 plot
Date   Tue, 28 Jun 2005 08:14:57 -0500

Nick and Nick - Thank you both. This is indeed an improvement over creating
separate variabels.

Al

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Sunday, June 26, 2005 11:28 AM
To: statalist@hsphsun2.harvard.edu
Subject: RE: st: variable color in Stata 8 plot

scatter y x if z==0 , mcolor(red) || scatter y x if z==1, mcolor(blue)

Nick
n.j.cox@durham.ac.uk 

Nick Winter
 
> I don't know of a way to do it directly as you awnted, but you can 
> avoid making new variables, by doing something liek:
> 
>    scatter y x if z==0 , mcolor(red) || y x if z==1, mcolor(blue)

> >I know I could accomplish this by
> >gen y0 = y if z==0
> >gen y1=y if z==1
> >scatter y0 y1x,mcolor(red blue)

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