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

Re: st: Xaxis range

From   Nick Winter <[email protected]>
To   [email protected]
Subject   Re: st: Xaxis range
Date   Wed, 23 Mar 2005 14:23:43 -0500

This has confused me periodically, too.

The issue is that the range of an axis can be expanded either by explicitly specifying a wider axis (with "xscale( range( ) )") or by specifying axis labels that include numbers outside the range of the data.

By default, twoway defaults to labeling the axes with "about" 5 ticks, the equivalant of

. scatter mpg price , xlabel(#5)

and this will expand the range of the axis to make for round numbers. So you need to specify a narrower set of labels.

. scatter mpg price , xlabel(minmax)

. scatter mpg price , xlabel(2000 7000 15000)

and so on.

--Nick Winter

At 02:11 PM 3/23/2005 -0500, you wrote:

I am creating a scatterplot in which the minimum x value is 3.002 and
the maximum value is 9.29 (it comes from a larger dataset in which I
have dropped values larger than 10 or smaller than 3). When I create a
twoway scatter the displayed graph ranges from 2 to 10. I would like
the left-hand axis to start at 3, which will not cut off any data, but
the xaxis(range(3 10)) option doesn't seem to do the trick, as I
suspected it wouldn't since the documentation suggests that this command
only expands ranges. Suggestions?

Jonathan Falk
Vice President, NERA
1166 Avenue of the Americas
New York, NY 10036
Phone: (212) 345-5315
Efax: (707) 922-0007


This e-mail and any attachments may be confidential or legally privileged. If you received this message in error or are not the intended recipient, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained herein. Please inform us of the erroneous delivery by return e-mail.

Thank you for your cooperation.


* For searches and help try:
Nicholas Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government [email protected] e
308 White Hall w
Cornell University
Ithaca, NY 14853-4601

* For searches and help try:

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