Statalist


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

Re: st: Axes for graphs


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Axes for graphs
Date   Wed, 25 Feb 2009 14:36:41 -0500

Try e.g.

sysuse auto, clear
gen y=(price-5000)/1000
gen x=mpg-20
loc x `"||scatteri 0 -10 "-10" 0 10 "10" 0 20 "20","'
loc x `"`x' mlabpos(6) mlabsize(*1.25)"'
loc x `"`x' msymbol(none)  mlabcolor(black)"'
loc x `"`x'||scatteri 0 -10 "|" 0 10 "|" 0 20 "|" ,"'
loc x `"`x' mlabpos(0) msymbol(none)  mlabcolor(black)"'
loc y `"||scatteri -3 0 "-3" 3 0 "3" 6 0 "6" 9 0 "9","'
loc y `"`y' mlabpos(9) mlabsize(*1.25)"'
loc y `"`y' msymbol(none)  mlabcolor(black)"'
loc y `"`y'||scatteri -3 0 "_" 3 0 "_" 6 0 "_" 9 0 "_","'
loc y `"`y' mlabpos(0) msymbol(none)  mlabcolor(black)"'
loc ax "yli(0,lc(black) lw(thin)) xli(0,lc(black) lw(thin))"
loc ax "`ax' ysc(off) xsc(off) leg(off)"
sc y x,`ax'`x'`y' scheme(s2mono) graphr(fc(white)) yla(,nogrid)


On Wed, Feb 25, 2009 at 2:20 PM, Austin Nichols <austinnichols@gmail.com> wrote:
> Philip Bromiley <bromiley@uci.edu>:
> see
> http://www.stata.com/statalist/archive/2008-11/msg00799.html
>
> On Wed, Feb 25, 2009 at 1:18 PM, Bromiley, Philip <bromiley@uci.edu> wrote:
>> Is there a way to have Stata put the axes in the center of the graph?
>> An editor wants the standard blackboard graph that has the y axis going
>> up the middle of the page and the x axis across the middle of the page
>> with the two meeting at (0,0).
>>
>> Sort of like this:
>>
>>                         Y
>>
>>                    5  |
>>                    4  |
>>                    3  |
>>                    2  |
>>                    1  |
>> ______________________________________  X
>>  -6 -5 -4 -3 -2 -1 |  1  2  3  4  5  6
>>                    -2 |
>>                    -3 |
>>                    -4 |
>>                    -5 |
>>
>

*
*   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