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

Re: st: eliminate blank marginal space with - graph, aspectratio(1) -

From   Scott Merryman <>
Subject   Re: st: eliminate blank marginal space with - graph, aspectratio(1) -
Date   Mon, 2 Feb 2009 15:01:41 -0600

The aspect ratio changes plot region of graph but does not change the
size of the graph.  See -help aspect_ratio- :

"   The overall size of the graph is not changed by the aspectratio()
option.  Thus constraining the
    aspect ratio will generally leave some additional space around the
plot region in either the
    horizontal or vertical dimension."

You can use the -graphregion(margin())- option to remove the margin
between the inner and outer regions.

Perhaps something like this:

 sysuse auto,clear
 scatter mpg price || lfit mpg price,  ///
   graphregion(margin(zero )) xsize(4) ysize(4.5) aspect(1) scheme(s1mono)


On Mon, Feb 2, 2009 at 1:24 PM, Jacob Wegelin <> wrote:
> Often I want to create a graph to export as a pdf or eps, for
> inclusion in a manuscript. The problem is that, although a command
> such as
> twoway (scatter y x) (line myfit x), aspectratio(1)
> graph export somegraph.pdf, replace
> produces a pretty plot, it is surrounded by a lot of blank marginal
> space to the left and right of the plot or above and below the plot.
*   For searches and help try:

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