[R] lattice levelplot axis + custom annotations

Alex Reynolds reynolda at u.washington.edu
Sun May 3 01:00:58 CEST 2009


How would I set the "scales" property of a lattice levelplot, so that  
I can add specific annotations at specific positions?

For example, I have a 200 x 1000 element levelplot. Along the y-axis  
(along the 1000-element axis) I would like to add annotations on the  
left side of the levelplot at elements 120, 300, 500, and 805, which  
represent clusters of interest.

Currently I have no annotations in my "scales" property:

colorFun <- colorRampPalette(c("white","black"))
myLevelplot <- levelplot(
	t(scale(set.allElements))[,myLevelplot.dendrogram.order],
	scales=list(y=list(draw=F),x=list(draw=F)),
	colorkey=F, col.regions=colorFun, aspect="iso",
	xlab="", ylab="", main="test title",
	legend=(list(right=
		list(fun=dendrogramGrob,
			args=list(x=myLevelplot.dendrogram, ord=  
myLevelplot.dendrogram.order,
				side="right", size=15, size.add=0.0,
				add=list(rect=list(col="transparent", fill=NA))))))
	)

Is there a straightforward way to add them?

Thanks,
Alex




More information about the R-help mailing list