Hi everyone. I want to solve the following problem. I have a data.frame and I create a dotplot using lattice.
Then I want to use the grid-package to create a combined graphic which contains the dotplot as well as a textplot() (using package gplots) of the data.frame next to the dotplot. Example code: library(lattice) library(grid) library(gplots) xx <- data.frame(f=factor(rep(1:5, each=5)), gr= rep(c("gr1", "gr2", "gr3", "gr4", "gr5"), 5), val=rnorm(25)) grid.newpage() pushViewport(viewport(layout = grid.layout(1, 2))) pushViewport(viewport(layout.pos.col=1, layout.pos.row=1)) p <- dotplot(f ~ val, groups=gr, xx, cex=1.7, pch=20) print(p, newpage=FALSE) popViewport(1) pushViewport(viewport(layout.pos.col=2, layout.pos.row=1)) textplot(xx, show.rownames=FALSE) popViewport(1) Obviously, this does not work since textplot() seems to call plot.new no matter what options are set with par(). My question: Is it possible to archieve my goal to plot the data.frame with textplot() next to the dotplot? And furthermore, if it is possible to do so, is it even possible to adjust the textplot in a way that the each row of the data.frame when plotted using textplot() is at the same height than the corresponding row in the dotplot? I guess that this is quite tricky and any hint on which package or functions I could use would be very helpful. Thank you very much. Bernhard ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.