[R] problem with lattice tiff or bitmap: character size and color

Einar Árnason einararn at hi.is
Sun Apr 5 14:29:28 CEST 2009

Hi all,

I am trying to make tiff files  of lattice plots at a resolution greater
than 300 dpi required by a journal (PLoS ONE). I have tried both the tiff
and bitmap functions. tiff keeps panel colors but reduces axes and tick
labels so they are nearly invisible. bitmap maintains correct label size
but only produces greyscale. Regular plots work fine with tiff; the
problem is only with lattice plots.

How can I keep the right sizes using tiff or, alternatively, how can I get
bitmap to produce colors?

I have made this test function using an xyplot example to demonstrate the

`test` <- function(tiff=F, bitmap=F)
### requires states
### states <- data.frame(state.x77, state.name = dimnames(state.x77)[[1]],
### state.region = state.region)
      bitmap("bitmaptest.tiff", width=17.15, height=17.15, units="cm",
res=1200, pointsize=10, type="tifflzw",bg="white")
res=1200, pointsize=10, compression = "lzw")
###      tiff(file="tifftest.tiff",width=17.15,height=17.15,units="cm",
###res=72, pointsize=10, compression = "lzw")
  plot(xyplot(Murder ~ Population | state.region, data = states,
            groups = state.name,
            panel = function(x, y, subscripts, groups)
            ltext(x = x, y = y, label = groups[subscripts], cex=0.5,
                  fontfamily = "HersheySans")))

> R.Version()
[1] "x86_64-redhat-linux-gnu"

[1] "x86_64"

[1] "linux-gnu"

[1] "x86_64, linux-gnu"

[1] ""

[1] "2"

[1] "8.1"

[1] "2008"

[1] "12"

[1] "22"

$`svn rev`
[1] "47281"

[1] "R"

[1] "R version 2.8.1 (2008-12-22)"

More information about the R-help mailing list