[R] dotplot axes labelling

David L Carlson dcarlson at tamu.edu
Mon Dec 15 17:21:50 CET 2014


You are very close. The argument scales(list(y=list())) supports multiple arguments for the y axis so you need to tell lattice how to use testylabels:

dotplot(testmatrix, scales=list(y=list(labels=testylabels), xlab=NULL))

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352


-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of rl at openmailbox.org
Sent: Monday, December 15, 2014 10:03 AM
To: r-help at r-project.org
Subject: [R] dotplot axes labelling

Subscribers,

What is my mistake with the following example:

library(lattice)
testmatrix<-matrix(c(1,2,3,4,3,6,12,24),nrow=4,ncol=2)
testylabels<-c('w1','x1','y1','z1')
dotplot(testmatrix, scales=list(y=list(testylabels)), xlab=NULL)
#testylabels not shown, instead 'D' 'C' 'B' 'A'

Thanks in advance.

--

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



More information about the R-help mailing list