[R] re placing default labels in lattice

Henrique Dallazuanna wwwhsd at gmail.com
Wed Aug 13 20:14:58 CEST 2008


You can see the source code of demo script:

file.show(system.file("demo/labels.R", package = "lattice"))

On Wed, Aug 13, 2008 at 11:20 AM, Andrewjohnclose <a.j.close at ncl.ac.uk> wrote:
>
> 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.
>
> ______________________________________________
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list