Statalist


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

Re: st: -graph twoway- and x-axis positioning


From   "Scott Merryman" <[email protected]>
To   [email protected]
Subject   Re: st: -graph twoway- and x-axis positioning
Date   Tue, 18 Nov 2008 13:35:21 -0600

Here is oneway:

scatter y mpg, yline(0, lc(black) lw(thin) ) xscale(off)  ///
 || scatteri 0 10 "10" 0 20 "20" 0 30 "30" 0 40 "40", mlabpos(6)
msymbol(none) mlabsize(*1.25) mlabcolor(black) ///
 || scatteri 0 10 "|" 0 20 "|" 0 30 "|" 0 40 "|", mlabpos(0)
mlabcolor(black) msy(none) legend(off)


Scott


On Tue, Nov 18, 2008 at 1:04 PM, Stephen P. Jenkins
<[email protected]> wrote:
>
> An Excel-using colleague has asked me how to have the x-axis of a
> twoway plot go through zero (or some other number) on the y-axis.
>
> Consider
>        sysuse auto
>        ge y = price - 5000
>        * x-axis below all values (default)
>        scatter y mpg
>        * line through zero; axis labelling and ticks below
>        scatter y mpg, yline(0) xscale(noline)
>        * ? how to force x-axis through zero ?
>
> I've looked through the [G] manual, and searched the Statalist
> archive, but have not yet been able to discover how to do this.  (It's
> not necessarily aesthetically desirable, I know, but I have been
> presented with the 'challenge'.)
>
>
> Stephen
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index