Statalist


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

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


From   Friedrich Huebler <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: eliminate blank marginal space with - graph, aspectratio(1) -
Date   Tue, 3 Feb 2009 17:17:06 -0500

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 <SJ@soci.au.dk> 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:        sj@soci.au.dk

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