[R] How to plot an expression-label with variable text (lattice variant)

Dieter Menne dieter.menne at menne-biomed.de
Sat Aug 28 17:55:48 CEST 2010


For the record: lattice behaves slightly differently, it requires an
"as.expression" with bquote.

Dieter

plotExp <- function(what) {
  plot.new()
  lab = bquote(Estimated~t[50]~ from ~.(what) ) ;
  text(0.5,0.2,lab)
}
plotExp("tgv")

library(lattice)
plotLattice <- function(what) {
  lab = bquote(Estimated~t[50]~ from ~.(what) ) ;
  # Note that ylab is wrong, xlab is correct
  xyplot(1~1,xlab=as.expression(lab), ylab=lab)
}
plotLattice("tgv")

-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-plot-an-expression-label-with-variable-text-tp2341465p2367176.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list