[R] aspect ratio 1 and blank space
Bert Gunter
gunter.berton at gene.com
Wed Nov 17 19:11:50 CET 2010
On Windows R 2.12.0, the following seemed to work for me:
par(pty="s") ## before plotting
plot(1:10,xlim=c(0,20),ylim=c(0,30))
I do not find that setting the asp parameter does anything useful;
indeed, the Help documentation seems to be backwards (asp=x/y not
y/x). I probably misunderstood and/or misused it, though -- asp seems
to interact with the xlim and ylim settings in inscrutable ways ... on
Windows, anyway.
HTH.
Cheers,
Bert
On Wed, Nov 17, 2010 at 9:26 AM, Silvia Cecere <scecere at yahoo.com> wrote:
>
> Hi,
> I need to produce an ordinary scatter plot and it is vital that the aspect ratio equals 1.
>
> I set the axis as:
>
> plot(x, y, type="n", asp=1, ,ylim=c(-80,70),xlim=c(0,100)).
>
> The problem is that I get some 'additional' blank plot area (basically, the lower bound of xlim becomes quite negative).
>
> The xlim is not the range of the x-data, but I need the 0 there for further plotting.
>
>
> Any way to specify that even with asp=1, xlim=c(0,100)?
>
> Thanks,
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Bert Gunter
Genentech Nonclinical Biostatistics
More information about the R-help
mailing list