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

st: RE: quirk: xlab overrides xscale in Stata8


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: quirk: xlab overrides xscale in Stata8
Date   Thu, 27 Mar 2003 11:45:35 -0000

Jan Brogger
> 
> Just upgraded to Stata 8, latest updates, Windows XP. A 
> quirk discovered
> in graphics. Stata8 does not respect the "xscale" option 
> when it figures
> out the "xlabels", and then "xlabels" takes precedence over 
> "xscale" in
> the drawing of the axis. It appears that "xscale" can only 
> be used to
> expand the xaxis to the right, not truncate it (even though you are
> within the limits of the data). You have to change both 
> xscale and xlab
> to achieve the desired effect. An example:
> 
> sysuse auto
> *range of weight is 1760 ro 4840
> summ weight
> 
> *default plot, x scale ranges from 1760 to 5000:
> scatter turn weight
> 
> *plot with x scale expanded to 6000, no problem:
> scatter turn weight, xsc(r(0,6000))
> 
> *plot with x scale restricted to the maximum value of the 
> data, does NOT
> work:
> scatter turn weight, xsc(r(0,4840)) 
> 
> *you have to also change the xlab option, then xscale takes effect.
> scatter turn weight, xsc(r(0,4840)) xlab(2000 4840)
> 
> This is somewhat counter-intuitive.

This is not really a quirk, but it is a change. 

In general, one change from 7 to 8 is that "nice round" labels 
(as formerly obtained by -xlabel- and/or -ylabel- without 
arguments) are now the default. Previously, the default 
was of course labelling based on data extremes. We could 
argue about whether that is a better default, but my 
own view is that it is. 

In this example, the default labelling of -turn- is 
2000 3000 4000 5000 and as Jan notes only by 
spelling out that you want something else 
can you change the labels. 

As before, the scale limits set -- now through 
r(min, max) -- act only to extend the axes from 
what the graph would be otherwise. In this 
case, only by changing the labelling explicitly 
does the "otherwise" change. 

Nick 
[email protected] 
*
*   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