Andreas Krause
2007-Oct-09 13:40 UTC
[R] lattice/xyplot: horizontal y-axis labels with scales(relation="free")
I would like to create an xyplot with varying y-axis limits and horizontal labels at the y-axis tickmarks. The following does not seem to work, although I think it should, going by the documentation for par. R version 2.5.1, Windows XP Prof. Thanks for a clue. Andreas Krause library(lattice) # axis labels for y-axis are horizontal xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris) # labels are now vertical xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free")) # still vertical despite las=1 xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free"), las=1) xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free", las=1)) # The example produces the same results for histogram(~Sepal.Width, ...)
Karl Ove Hufthammer
2007-Oct-09 14:00 UTC
[R] lattice/xyplot: horizontal y-axis labels with scales(relation="free")
Andreas Krause:> # still vertical despite las=1 > xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, > scales=list(relation="free"), las=1) xyplot(Sepal.Length ~ Sepal.Width | > Species, data=iris, scales=list(relation="free", las=1))Try xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free", rot=0)) lattice uses 'rot' instead of 'las' for rotating the labels. -- Karl Ove Hufthammer
Rafael Duarte
2007-Oct-09 16:42 UTC
[R] lattice/xyplot: horizontal y-axis labels with scales(relation="free")
For y-axis only: xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(y=list(relation="free", rot=0))) Andreas Krause wrote:>I would like to create an xyplot with varying y-axis limits and horizontal labels at the y-axis tickmarks. >The following does not seem to work, although I think it should, going by the documentation for par. >R version 2.5.1, Windows XP Prof. >Thanks for a clue. > > Andreas Krause > >library(lattice) > ># axis labels for y-axis are horizontal >xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris) > ># labels are now vertical >xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free")) > ># still vertical despite las=1 >xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free"), las=1) >xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free", las=1)) > ># The example produces the same results for histogram(~Sepal.Width, ...) > >______________________________________________ >R-help at 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. > >-- Rafael Duarte Marine Resources Department - DRM IPIMAR - National Research Institute for Agriculture and Fisheries Av. Bras?lia, 1449-006 Lisbon - Portugal Tel:+351 21 302 7000 Fax:+351 21 301 5948 e-mail: rduarte at ipimar.pt