search for: gridplt

Displaying 12 results from an estimated 12 matches for "gridplt".

2008 Dec 05
1
Trouble with gridBase and inset plots
Dear All, I ma having a trouble in generating a figure containing 3 insets with the gridBase package. I always get an error message of the kind: Error in gridPLT() : Figure region too small and/or viewport too large No matter which parameters I choose. The plots works nicely with two insets only, but when I try adding the third one, my troubles begin. I am probably doing something wrong in the generation of the 3rd inset and I paste below everything I do i...
2011 Apr 28
2
gridBase Base Plot Positioning
...wport(c(5, 5, 4, 2))) pushViewport(viewport(layout = grid.layout(4, 6))) for(i in 1:5) { for(i2 in 1:4) { pushViewport(viewport(layout.pos.row = i2, layout.pos.col = i)) grid.rect() popViewport() } } pushViewport(viewport(layout.pos.col = 6)) plot.new() par(plt = gridPLT(), new = TRUE) randData <- lapply(1:4, function(x) sample(10, 10, TRUE)) boxplot(randData, horizontal = TRUE) dev.off() I'm using gridBase_0.4-3. Thanks, Dario. -------------------------------------- Dario Strbenac Research Assistant Cancer Epigenetics Garvan Institute of Medical R...
2012 Sep 23
1
Background color in a grid plot seems to interfere with plot()
...i. <- if(i > 1) i+2 else i+1 # jumping over gaps for(j in 1:2) { # columns j. <- if(j > 1) j+2 else j+1 # jumping over gaps pushViewport(viewport(layout.pos.row=i., layout.pos.col=j.)) grid.rect(gp=gpar(fill="gray90")) # background par(plt=gridPLT()) ## plot plot(1:10, 1:10, log="y", xlab="", ylab="", xaxt=if(i==2) "s" else "n", yaxt=if(j==1) "s" else "n") par(new=TRUE) # to be run after first plot upViewport() } } par(par.)...
2008 Aug 08
2
gridBase and new.page() / grid.newpage()
...t(width = .8, height = .8, layout = datalayout)) grid.rect(gp=gpar(col="grey")) for(i in 1:n) { pushViewport(viewport( y = i/n - 0.5 / n, x = 1, height = unit(1/n, 'npc'), width = unit(1/n, 'npc'))) par(plt = gridPLT(), new = TRUE) grid.rect(gp=gpar(fill="light grey")) dens <- density(rnorm(10)) plot.density(dens, axes = FALSE, mar = c(0,0,0,0), main = "", xlab = "", ylab = "") upViewport() } pushViewp...
2003 Oct 19
0
Oceanographic lattice plots
...erlay later push.viewport(viewport(layout.pos.row=i*2, layout.pos.col=j, yscale=c(400, 0))) grid.rect(gp=gpar(col="grey")) # Draw first plot # Here's where we use gridBase to put a plot into a grid viewport # The par(plt=gridPLT()) makes the plotting region line up with # the current grid viewport (pushed two lines ago) par(plt=gridPLT(), new=TRUE, cex=0.8) plot(zt[,index],-p[,1], ylim=c(400,0), xlim=c(6,15), type='l', xlab="",ylab="", axes=FALSE, xpd=FALSE)...
2008 May 02
1
Error in downViewport.vpPath(vpPathDirect(name)
Hi, I am having trouble plotting a series of dendrograms using lattice and grid code as found in Paul Murrells book R Graphics. This is the error message I recieve: Error in downViewport.vpPath(vpPathDirect(name), strict, recording = recording) : Viewport 'plot1.panel.1.1.off.vp' was not found I have attached the code and also my data file. Should anyone have any suggestions then
2006 Apr 04
1
Grid graphics issues
...brary("lattice"); library("gridBase"); trellis.par.set(theme = col.whitebg()); outer.plot.limits = c(0.75, 5.25); inner.plot.limits = c(0.92, 5.08); sunpanel <- function(x, y, subscripts, ...) { pushViewport(viewport(x = 0.5, y = 0.5, just = "center")); par(plt = gridPLT(), new = TRUE); sunflowerplot(x, y, axes = FALSE, xlab = "", ylab = "", xlim = inner.plot.limits, ylim = inner.plot.limits); popViewport(1); } for (i in 1:10) { x = round(runif(100, 1, 5)); y = round(runif(100, 1, 5)); print(xyplot(y ~ x, xlim = outer.plo...
2008 May 13
1
Bubble plot pie chart map
...h Base Graphics Output" (in R News) to try and do this (using the gridBase package). It generally works well, except for when I try and put in the map of the coastline and the points with no zooplankton present (0 values of both plankton species). The following error comes up: "Error in gridPLT() : Figure region too small and/or viewport too large" and other errors along those lines. Can anyone suggest either what I'm doing wrong, or some other way to plot this? Many thanks Deborah Deborah Davidson PhD student School of Biological Sciences University of Aberdeen Aberdeen,...
2012 Oct 19
1
grid(Base): How to avoid "Figure region too small and/or viewport too large" by specifying 'relative' units?
...bsolute measurements, i.e., specify all units in inches. This worked perfectly fine for me initially. However, when the device width and height are not set accordingly (and one can never know what others specify here -- indeed the problem arose this way), this produces errors of type "Error in gridPLT() : Figure region too small and/or viewport too large". I also found this issue in this post (https://stat.ethz.ch/pipermail/r-help/2008-December/181993.html), but I am wondering what's the correct approach towards this problem / how can one specify "relative" units but guarante...
2005 Feb 13
1
Transparent Pie Charts
Hi again! I put this question in another topics post before but I fear it might drown there. Is it possible to have transparent / alpha blended colors for pie charts? I am using the pies in a map of pies and those pies are sometimes overlapping so it would be great to see if another pie lies beneath. Thanks, Werner
2008 Sep 20
0
gridBase and layout
...> vps <- baseViewports() > pushViewport(vps$inner, vps$figure, vps$plot) > pushViewport(viewport(x = unit(-1.8, "native"), y = unit(0.7, > "native"), > width = unit(1.5, "native"), height = unit(0.6, "native")) ) > > par(plt = gridPLT(), new = TRUE, mgp = c(1.8, 0.5, 0)) > # > # small inset at the top-left corner > # > plot(x, y, ylab="label2", cex=0.8) > popViewport() > popViewport(3) > # > # bottom graph > # > par(mar = c(3.5, 3.5, 0, 1), mgp = c(1.8, 0.5, 0), pty = "m", xpd =...
2008 Jun 11
1
Problem when combining dotplot() and textplot() using grid
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)),