[R] lattice .ps graphic is rotated in LaTeX slides

Michael Friendly friendly at yorku.ca
Wed Sep 29 16:32:38 CEST 2004

I've generated a version of the classic dotplot of the barley data with


trellis.device("postscript", color=TRUE, file="barley2x3.ps")
old.settings <- trellis.par.get()
trellis.par.set("background", list(col = "white"))
lset(list(superpose.symbol=list(pch=c(19, 1, 25, 2, 15, 22, 23),
        cex=rep(1,7),col=c("blue", "red", "darkgreen", "brown",
        "orange", "turquoise", "orchid") )))
lset(list(fontsize = list(default = 14)))

n <- length(levels(barley$year))
dotplot(variety ~ yield | site, data = barley, groups = year,
  layout = c(2, 3), aspect = .5,
  xlab = "Barley Yield (bushels/acre)",
  key = list(points = Rows(trellis.par.get("superpose.symbol"), 1:n),
    text = list(levels(barley$year)), columns = n))

It looks fine with gv (though I'd like to make the bounding box 
tighter), but when I embed it in a LaTeX slide
(landscape, using seminar package),


the image is rotated 90 deg CCW.  I tried to adjust for this with


but  that gives
! Package graphics Error: Division by 0.
What am I doing wrong, or how could I do it differently so it would work?


Michael Friendly     Email: friendly at yorku.ca 
Professor, Psychology Dept.
York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

More information about the R-help mailing list