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

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Nov 14 03:19:08 CET 2007


On Nov 13, 2007 10:28 PM, Daniel Malter <daniel at umd.edu> wrote:
> 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)

I get:

Error in sample(bidder, 2500, replace = TRUE) : object "bidder" not found

> 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.

scales = list(y = list(draw = FALSE))

-Deepayan

> 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
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list