[R] get ylim of current plot()

Dimitrios Rizopoulos Dimitris.Rizopoulos at med.kuleuven.be
Thu Aug 31 20:43:08 CEST 2006


I don't think you can obtain these values directly since  
plot.default() does not return something.

'ylim' is in fact calculated from xy.coords() as the range of the  
finite 'y' abscissa values; check the code of plot.default() for more  
info.

I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
      http://www.student.kuleuven.be/~m0390867/dimitris.htm


Quoting William Valdar <valdar at well.ox.ac.uk>:

> Dear All,
>
> How can I query the parameters of the current plot if it was produced by
> plot()? For example, if I do not specify ylim explicitly, eg,
>
>   plot(rnorm(100), rnorm(100))
>
> then how do find out what ylim was chosen? Note that I realize this is
> possible with lattice's xyplot():
>
>   (obj <- xyplot(rnorm(100), rnorm(100)))
>   print(obj$y.limits)
>
> Thanks in advance,
>
> Will
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Dr William Valdar               ++44 (0)1865 287 589
> Wellcome Trust Centre           valdar at well.ox.ac.uk
> for Human Genetics, Oxford      www.well.ox.ac.uk/~valdar
>
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
>
>



Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



More information about the R-help mailing list