A square graph can be specified with the xsize() and ysize() options.
. scatter mpg weight, graphregion(margin(0 0 0 0)) aspectratio(1)
xsize(4) ysize(4)
Friedrich
On Tue, Feb 3, 2009 at 1:59 PM, Svend Juul <[email protected]> wrote:
>
>
> Jacob 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.
>
> Friedrich suggested:
>
> The margins can be fine-tuned with the margin(# # # #) syntax. See
> -help marginstyle-.
>
> . scatter mpg price, graphregion(margin(2 2 2 2)) plotregion(margin(0 0 0 0))
>
> ========================================================
>
> Jacob wants (a reasonable wish) to be able to define the plot
> aspect ratio and at the same time eliminate blank marginal space.
> Friedrich's suggestion did not include the aspectratio() issue, and
> in the following command, the blank space is not eliminated:
>
> scatter mpg price, graphregion(margin(0 0 0 0)) aspectratio(1)
>
> I don't think it can be done from syntax except by using the
> trial-and-error method. It requires that the contents of a graph
> could affect its overall size, overriding any explicit or implicit
> xsize() and ysize() options. I don't think it can be done.
>
> This didn't help much
> Svend
>
> ________________________________________________________
>
> Svend Juul
> Institut for Folkesundhed, Afdeling for Epidemiologi
> (Institute of Public Health, Department of Epidemiology)
> Bartholins Allé 2
> DK-8000 Aarhus C, Denmark
> Phone, work: +45 8942 6090
> Phone, home: +45 8693 7796
> Fax: +45 8613 1580
> E-mail: [email protected]
*
* 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/