[R] lattice contourplot line types

Andrew Beckerman a.beckerman at sheffield.ac.uk
Sun Feb 22 21:45:11 CET 2009


Dear all -

I would like to adjust the line type of specific contours in  
contourplot from the lattice package, but it seems like lty does not  
take a list in the call.

Here is my call to contourplot:

contourplot(preds~size+trt|Size.Name,
	data=pred.dat,layout=c(2,4),
	at=c(0.025,0.5,0.975),
	par.strip.text=list(cex=1.2),
	scales=list(cex=0.5),
	xlab=list("Size",cex=1.2),
	ylab=list("Treatment",cex=1.2),
	panel=function(x,y,z,...){
		panel.contourplot(x,y,z,lwd=1,...)
		panel.grid(h=-1,v=-1,col="grey",...)})

I would like to specify lty=c(2,1,2) corresponding to the  
at=c(0.025,0.5,0.975), and have tried this in both the core part of  
the call, and in panel.countourplot.  However, it only recognises the  
first type.

If there is no straightforward answer, I can provide the data.

Best wishes,
Andrew

R version 2.8.1 (2008-12-22)
i386-apple-darwin8.11.1

locale:
en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] MASS_7.2-45     lattice_0.17-17

loaded via a namespace (and not attached):
[1] grid_2.8.1




More information about the R-help mailing list