Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: giving xline a range?


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: giving xline a range?
Date   Fri, 5 Sep 2008 10:18:59 -0400

Or use -spike- e.g.

sysuse auto
loc pts="0 `=price[20]' `=mpg[20]' `=price[20]'"
sc mpg price ||scatteri `pts', c(l) ms(none) leg(off)
sc mpg price ||scatteri `pts', recast(spike) leg(off) name(r)
sc mpg price ||spike mpg price if _n==20, leg(off) name(s)


On Thu, Sep 4, 2008 at 10:58 PM, Nick Winter <nwinter@virginia.edu> wrote:
> Probably the best, maybe the only, approach is to use -scatteri- to make
> your own line(s) wherever you need them:
>
> . sysuse auto
>
> . gr twoway scatter mpg price ||
>        scatteri 20 5000 40 5000, c(l) msym(none) legend(off)
>
>
> Stata draws the plots from left to right, so you can reverse them to put the
> line behind the scatter points.
>
> --Nick Winter
>
>
> Will Kessler wrote:
>>
>> Hello,
>> I'm wondering if there's a way to display "xline" over only a specified
>> range, i.e. from the point on a curve to the point of x-intercept?
>> Will Kessler
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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