Thank you very much Greg,

This was helpful.
With yaxs="r" I can easily obtain the Y-axis labels with :

    rg <- range(y) + 0.04 * diff(range(y)) * c(-1, 1)
    pt <- pretty(y)

    axTicks(side=2,
             usr=c(0, 1, rg),
             axp=c(min(pt),
                   max(pt[pt <= max(rg)]),
                   length(pt[pt <= max(rg)]) - 1))

*y* being either the values to plot or the ylim parameter.

Your remark on the use of strwidth is absolutely true. Thus I'll simply 
assess linear parameters to get correct mgp values as a function of 
maximum character numbers within the axis labels, using standard font size.

All the best,
Yves

Le 12/02/2011 00:56, Greg Snow a écrit :
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to