[R] suppress y-axis in a dotplot (lattice)

Daniel Malter daniel at umd.edu
Tue Nov 13 23:28:07 CET 2007


Hi,

I want to illustrate when individuals had an event over time. I am using
dotplot from the lattice library. The plot itself works well, but as I have
many individuals, the labels on the y-axis for these individuals overlap. So
the y-axis is unreadable. Therefore, I want to suppress the labels on the y
axis. I could not get it done. axes=FALSE does not work and I tried other
methods, but it seemed to be the wrong command for dotplot (or lattice).

To see what I mean you can run the following code:

library(lattice)
TIME=runif(250,0,200)
vector=array(TIME,dim=c(2500))
subj=c(1:250)
SUBJECT=sample(bidder,2500,replace=TRUE)
dotplot(SUBJECT~TIME,xlab="Calendar day",ylab="Events by
individual",col=c("black"),col.line="grey90",pch=43)

That is, I am looking for the argument in the dotplot() function call that
makes the mess on the y-axis disappear. Alternatively, I would also use a
different type of plot if it serves the same purpose. In particular it would
be nice if the horizontal lines connect only an individuals events (so that
they are not a grid, but rather a function of the data).

Thanks much,
Daniel



More information about the R-help mailing list