[R] re placing default labels in lattice

Andrewjohnclose a.j.close at ncl.ac.uk
Wed Aug 13 16:20:10 CEST 2008


Dear all,

I am having a little trouble deciphering how to change the default x-axis
labels in a lattice xyplot (or any type of lattice plot for that matter). I
have tried using the "demo("labels") function but the code is truncated at
precisely the wrong moment!

All I am trying to do is to add superscript to two of the labels for which i
tried using the expression function. It partly works, but it prints only the
first replacement label inside the plotting region and forgets the
rest...what am I missing?

Thank you

xyplot(resid(mod4)~factor(distance),aspect=1.0,cex=1.0,xlab="Distance",ylab="Residuals",data=meanAG,
span=1,
panel=function(x,y,span){
panel.grid(h=0, v=-1)
panel.xyplot(x,y,cex=1.0,points="jitter")
panel.loess(x,y, span)
panel.axis(side="bottom",at=TRUE,
labels=c(expression(Bray-Curtis^{1}),expression(Bray-Curtis^{2}),expression(Canberra),expression(Gower),expression(Hellinger),expression(Kulczynski)))
})
http://www.nabble.com/file/p18964008/meanAG.csv meanAG.csv 
-- 
View this message in context: http://www.nabble.com/replacing-default-labels-in-lattice-tp18964008p18964008.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list