Re: [Rd] mtext adj= wrong with several las= (PR#7188)

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Fri 27 Aug 2004 - 17:05:09 EST

Jens Oehlschlägel wrote:

>>No, adj moves not always along the axis:
>
>
> No, not yet. But mtext logically is oriented relative to its axis. And it
> should behave consistently relative to its axis.
>
> Whichever solution is choosen finally, I think it is important, that the
> default parametrisation will handle multi-line labels such that they are
> centered around at= and aligned at line=, whatever side= and las= are
> choosen. Beeing forced to tweak with adj= / padj= depending on side= / las=
> would be very impractical. This "requirement" is easily fullfilled with
> default adj=0.5 if we have mtext's adj= always move along the axis. With a
> adj= / padj= solution, different defaults would be needed for the different
> combinations of side= and las=.

Might be nice, but I don't think we can easily change that much in mtext()'s behaviour. It is widely used in graphic functions and changing the defaults too much will break an incredible amount of code (if someone changes mtext() in that manner, I'll unsubsribe from R-help for half a year ;-)).

> How does it S+?

The outdated S-PLUS 4.5 behaves like R does, but the logic is different since you have to specify srt rather than las.

Uwe Ligges

> Best
>
>
> Jens
>
>
> # Thats my problem
> txt <- "This are\nfour lines\nof some\nrubish"
> y <- barplot(x, axes=FALSE, axisnames=FALSE, horiz=TRUE)
> # axis doesn't align it properly
> axis(2, label=rep(txt, 5), at=y, las=2, adj=0)
> # and no mtext parameters give vertically centered and right adjusted text
> mtext(rep(txt, 5), side=2, line=1, at=y, las=2, adj=0)
>
>



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Aug 27 17:15:37 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:10 EST