Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: tsline: narrowing the range using range()


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: tsline: narrowing the range using range()
Date   Thu, 22 Aug 2013 21:53:16 +0100

See http://www.stata.com/support/faqs/graphics/scale-breaks/ (second part)
Nick
[email protected]


On 22 August 2013 21:15, Daniel Pollmann <[email protected]> wrote:
> I am plotting a time series using tsline. The time series takes values in
> [0,100], but I would like to restrict the range of the y-axis to [0,20], such
> that the time series would spike out of the plot at some point and return
> later.
>
> The following code does not enforce the specified plot range when it is not a
> superset of the range of the data:
>
> tsline myseries, yscale(range(0 20))
>
> In other words, if I have data points equal to 100, Stata widens the range
> automatically to accommodate these points. Winter (Stata J., 2005) describes
> the problem:
>
> "To determine the range of an axis, Stata begins with the minimum and maximum
> of the data. Then it will widen (but never narrow) the axis range as instructed
> by
> range(). Finally, it will widen the axis if necessary to accommodate any axis
> labels."
>
> (http://www.stata-journal.com/sjpdf.html?articlenum=gr0019)
>
> I would like to be able to narrow the axis range, either using range() or some
> other way. If there is an intended way to do this, it would be great to hear
> about it, but I am also open to creative fixes and hacks. I've tried censoring
> and truncating the data myself, but neither option produces nice-looking
> results.
>
> Thanks,
>
> Daniel
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index