Re: [R] missed ylim from plot.default

From: Antonio, Fabio Di Narzo <antonio.fabio_at_gmail.com>
Date: Fri 26 May 2006 - 17:28:32 EST

2006/5/26, Peter Ehlers <ehlers@math.ucalgary.ca>:
>
>
> Antonio, Fabio Di Narzo wrote:
>
> > Hi all.
> > On my R-2.3.0, calling:
> >
> >
> >>plot(1:5, rep(1,5), xlim=c(-0.5,7), ylim=c(-0.5,2.8), asp=1)
> >
> >

> > gives to me a plot (tried pdf and X11) whose y axis goes from about -2
> to
> > about 4.5. What I've missed? How can I show some pre-specified x and y
> > ranges from a plot (keeping fixed the aspect ratio)?
> >
> > Tnx all,
> > Antonio, Fabio Di Narzo.
> >
> > [[alternative HTML version deleted]]
>
> Do you want a wide, but not very tall plot? If so, you
> could specify the width/height in your X11() call.

>
> Peter Ehlers
>
>
Tnx for your indication, now I see: x and y plotting ranges are influenced by the actual window size (at least when fixing aspect ratio). I think this is obvious... What I missed/forgot above, was that default plot width and height are fixed indipendently from the 'x-ylim' and 'asp' arguments.

However now I have a problem: I can write a wrapper to set device width and height depending on the (xlim,ylim,asp) triple. But there's often extra-space in the device due to plot title, axis labels, etc. So, I fear I can't simply set width=height*asp. Some suggestion? (Anyway, by now I only have to produce few plots, so today I can go try by try :-) ).

Bests,
Antonio.

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 26 17:46:03 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 26 May 2006 - 18:10:26 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.