Statalist The Stata Listserver


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

Re: st: Graphs by and different axis scales [Stata 9]


From   "Scott Merryman" <[email protected]>
To   [email protected]
Subject   Re: st: Graphs by and different axis scales [Stata 9]
Date   Tue, 26 Jun 2007 14:58:32 -0500

There are several suboptions that can be used with by() (see -help by option-)

I believe you want the -yrescale- option.

For example,

. sysuse auto
(1978 Automobile Data)

. replace mpg = mpg*1000 if fore == 1
mpg was int now long
(22 real changes made)

. scatter mpg price, by(fore, yrescale)



On 6/26/07, R.E. De Hoyos <[email protected]> wrote:
I am plotting a two-way graph of varX and varY by years (4 years):

   . tw scatter varY varX, by(year)

Y varies so much across the 4 time periods that Stata assigns a very large
range of variation to Y, say from -100 to +100 for all four years. For any
given year, the variation in Y is much less than -100 to +100, so I would
like to have a year-specific axis range. An obvious way of doing this is to
compute separate graphs for each year:

 foreach y in 1 2 3 4 {
   tw scatter varY varX if year==`y'
}

Nevertheless I would like to have the four graphs in a single object (.eps).
Is there a way to do this?

Thanks,
Rafa

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