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

st: behaviour of xtick(##) and ytick(##) options

From   "Nick Winter" <>
To   <>
Subject   st: behaviour of xtick(##) and ytick(##) options
Date   Tue, 4 Feb 2003 08:51:55 -0500

Vince Wiggins wrote:
> Graphics in Stata 7 and before attempted to be parental and 
> guess at what you
> meant by an option or specification, with the hope that the 
> result would be
> pretty.  In Stata 8 graphics our overriding rule has been to increase
> flexibility and let users specify exactly what they want, 
> even though the
> result may be ugly.  A large part of the flexibility in the 
> new graphics comes
> from not trying to second guess the user, but rather directly 
> render what is
> requested.

Changing the subject -- am I missing something, or is there no longer
any automated way to get Stata 8 to handle axes the way Stata 7 did by
default: that is, range from data min to max, min and max labeled, with
five tick marks evenly spaced from min to max.  The first two are easy,
with the -xlab(minmax)- and -ylab(minmax)- options.

However, the tick marks aren't so easy, because -xtick(##)- and
-ytick(##)- (that is, options of the form xtick(#5) or xtick(#4) have
code to choose "nice" values for the ticks, which sometimes widen the
range, sometimes fall within the range, and are, in any case, not evenly

This seems like an example of Stata doing what it thinks I want, rather
than what I want.  (Or, an example where what I want is "evenly spaced",
and the option on offer is "nice".  You say potatoe . . .)

Is there a way to say, "I want X number of ticks, and I want them spaced
evenly within the graph range"?  The only way I see now is something

	. sum price
	. local ticks `r(min)'(`=(`r(max)'-`r(min)')/4')`r(max)'
	. sc mpg price , xlab(minmax) xtick(`ticks')

Hardly elegant . . .

Am I missing something?
Nick Winter
*   For searches and help try:

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