The usr parameter is either ylim or ylim plus 4 percent on either side (see
yaxs/xaxs), see the pretty function for possible ways to get the yaxp
information. Note that strwidth is based on the current coordinate system and
will not give you the proper values unless the plot region has already been set
up.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Yves REECHT
> Sent: Friday, February 11, 2011 3:38 AM
> To: r-help at r-project.org
> Subject: [R] How to compute "yaxp" and "usr" without
plotting ?
>
> Dear all,
>
> I'd like to know how I could compute the parameters "yaxp"
and (the y
> components of) "usr" without having to plot the data first. Note
that
> "ylim" is /a priori/ fixed.
>
> The aim is to automatically adjust the parameter "mgp" without
having
> to
> make the plot twice. Then, with "yaxp" and "usr" known,
it should be
> easy to calculate a suitable "mgp" with the axTicks and strwidth
> functions.
>
> Many thanks in advance,
> Yves
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.