Statalist


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

Re: st: how to remove axis margin from plot


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: how to remove axis margin from plot
Date   Fri, 13 Feb 2009 09:11:27 -0600

On Thu, Feb 12, 2009 at 7:42 PM, David Airey <[email protected]> wrote:
> .
>
> This doesn't seem to work when combined with -aspect(1)- option.
>
> -Dave

drop _all
set obs 10
gen x = _n
twoway line x x, graphregion(margin(zero ))  xlabel(1(1)10) ylabel(1(1)10) ///
 aspect(1) name(apsect1,replace)

True.  So to get square graph with a square plot region you could
specify the -xsize()- and -ysize()- :

twoway line x x, graphregion(margin(zero )) xlabel(1(1)10)
ylabel(1(1)10, angle(h)) ///
 aspect(1) xsize(5) ysize(5) name(apsect2,replace)

If you have legend, then room needs to be made for that in the -ysize()- :

twoway line x x x, graphregion(margin(zero )) xlabel(1(1)10)
ylabel(1(1)10, angle(h)) ///
 aspect(1) xsize(5) ysize(5.25) name(apsect3,replace) legend(bmargin(zero))

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