Statalist


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

Re: st: Axes for graphs


From   Austin Nichols <[email protected]>
To   [email protected]
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 <[email protected]> wrote:
> Philip Bromiley <[email protected]>:
> see
> http://www.stata.com/statalist/archive/2008-11/msg00799.html
>
> On Wed, Feb 25, 2009 at 1:18 PM, Bromiley, Philip <[email protected]> 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index