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

st: quirk: xlab overrides xscale in Stata8


From   "Jan Brogger" <[email protected]>
To   "Statalist" <[email protected]>
Subject   st: quirk: xlab overrides xscale in Stata8
Date   Thu, 27 Mar 2003 12:31:09 +0100

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.

Yours, Jan Brogger, University of Bergen

*
*   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