[R] rotated ylab with xyplot

Austin, Matt maustin at amgen.com
Tue Nov 29 06:00:45 CET 2005


Try

library(grid)
xyplot(y~x,data.frame(x=1:10,y=runif(10)), ylab=textGrob(label="my label",
rot=0))

Note in the ?xyplot the xlab/ylab section points to the 'main' parameter
where it defines that a list can be used, however string rotation parameters
are not in the list.  The helpfile notes that a grob object can be used.

The reference for lattice and grid is R Graphics by Paul Murrell.

--Matt

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Viet Nguyen
> Sent: Monday, November 28, 2005 8:33 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] rotated ylab with xyplot
> 
> 
> hi all,
> 
> in R, what's the best way to have a rotated ylab in a graph 
> plotted with 
> either xyplot or xYplot?  I tried this but it didn't work.
> 
> xyplot(y~x,data.frame(x=1:10,y=runif(10)),ylab=list(srt=90,crt
> =90,rot=90,label="my label"))
> 
> 
> more generally, how do you output a text at an angle in a 
> lattice graph?
> 
> what would be a good reference for R lattice graphics?  I 
> need more help 
> than the help pages provide.
> 
> thank you in advance.
> 
> vn
> 
> ______________________________________________
> 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
>




More information about the R-help mailing list