Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Regaining control over axis ranges

From   annoporci <>
Subject   Re: st: Regaining control over axis ranges
Date   Tue, 25 Dec 2012 20:39:34 +0800

You don't spell out what does not work, but -?scale()- options don't
omit data. That's the most common misunderstanding among those who
don't read the help carefully.


Oops, sorry about that. Here is what I want:

I'm trying to shorten the y axis of a graph.

Here is what I read in Stata Tips 23:

"to get a narrower x-axis, we must specify a narrower set of axis labels...

Let me reframe the question in terms of the Stata Tips 23 examples (based
on the auto dataset and the x-axis):

Say I want the x-axis to run from 5,000 to 10,000. Since the actual data
extends below and above these values, I am willing to omit data from the
graph. What can I do to achieve this goal?

This won't do:

twoway scatter mpg price, xscale(range(5000 10000)) xlabel(5000[1000]10000)

The Stata Tip says "to get a narrower x-axis, we must specify a narrower
set of axis labels," which at the time I took to mean that omitting data
could be achieved that way, but now I realize that the intended meaning
was probably "to get a narrower x-axis, but without omitting any data,

So yes, I would like to shorten the axis and omit data in the process.

Thanks for your help!

Patrick Toche.
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index