I've generated a version of the classic dotplot of the barley data with library(lattice) data(barley) 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)) dev.off() lset(theme=old.settings) 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), \begin{slide} \includegraphics[,height=.6\textheight]{fig/barley2x3.ps} \end{slide} the image is rotated 90 deg CCW. I tried to adjust for this with \includegraphics[angle=-90,height=.6\textheight]{fig/barley2x3.ps} 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? thanks -- 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
I've generated a version of the classic dotplot of the barley data with library(lattice) data(barley) 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)) dev.off() lset(theme=old.settings) 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), \begin{slide} \includegraphics[,height=.6\textheight]{fig/barley2x3.ps} \end{slide} the image is rotated 90 deg CCW. I tried to adjust for this with \includegraphics[angle=-90,height=.6\textheight]{fig/barley2x3.ps} 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? thanks -- 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
On 2 Oct 2004, at 8:04 PM, r-help-request at stat.math.ethz.ch wrote:> On Fri, 2004-10-01 at 10:58, Peter Dalgaard wrote: >> Michael Friendly <friendly at yorku.ca> writes: >> >>> ! Package graphics Error: Division by 0. >>> >>> What am I doing wrong, or how could I do it differently so it would >>> work? >> >> You might try \usepackage{graphicx} instead. I seem to recall >> (vaguely) getting better results with that sometimes. > > > That should be part of the preamble for using 'seminar', if it is setup > properly. > > There is a decent tutorial for using seminar at: > > http://astronomy.sussex.ac.uk/~eddie/soft/tutorial.html > > There is also a great reference for including graphics in LaTeX: > > www.ctan.org/tex-archive/info/epslatex.pdf > > FWIW, though I have been using seminar for such presentations, I have > been recently looking at the Beamer package: > > http://latex-beamer.sourceforge.net/ > > and of course, there is also the Prosper package: > > http://prosper.sourceforge.net/ > > The one advantage of the Beamer package, for those that require it, is > that it supports pdflatex, which the others do not. Though, it can be > used with dvips/latex + ps2pdf, where needed. > > HTH, > > MarcNote also the package pdfscreen, for use with pdflatex www.river-valley.com/download2.shtml This pretty much uses regular latex, with the page dimensions changed and the font attributes redefined to make them larger than usual inside the slide environment. Be sure to load the packages xspace and colortbl as well as pdfscreen. John Maindonald email: john.maindonald at anu.edu.au phone : +61 2 (6125)3473 fax : +61 2(6125)5549 Centre for Bioinformation Science, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian National University, Canberra ACT 0200.