Skip to content
Prev 257459 / 398506 Next

splom, plotmath: how to add three lines of information with alignment?

On 20 April 2011 19:23, Marius Hofert <m_hofert at web.de> wrote:
Initializing your array with a list seems to work for whatever reason
that's well above my head,

expr.arr <- array(list(NA,NA,NA), dim=c(d,d,3), dimnames=c("i","j","val"))

As for the alignment, there should be a better way using multiple
columns in grid.table, but parse is struggling to interpret the = sign
on its own. Again, I'm not sure why, this is deep magic to me.


library(gridExtra)
d = matrix(c("italic(a)==phantom('')", round(pi,4),
  "italic(b)==phantom()", round(pi,6)), ncol=2, byrow=T)

grid.table(d, parse=T,theme=theme.list(
                  gpar.corefill=gpar(fill=NA, col=NA),
                  core.just="left", padding.h = unit(0, "mm") ))

HTH,

baptiste