Displaying 20 results from an estimated 3000 matches similar to: "Problem going back to a viewport with gridBase"
2009 Mar 31
1
viewport bug in 2.8.0?: Error: Cannot pop the top-level viewport (grid and graphics output mixed?)
I get the following error message followed by instability in R after the
error message:
Error: Cannot pop the top-level viewport (grid and graphics output
mixed?)
Have reduced something much more complex in my code to a simple test case.
I run the following and then resize the window:
X = seq (1,10)
Y = X^2
opar <- par(no.readonly=TRUE, mar = c(2.5, 3.1, 1, 2))
grid.newpage()
2006 May 21
1
print.trellis(..., draw.in=...)
A year ago I had posted this code
https://stat.ethz.ch/pipermail/r-devel/2005-June/033508.html
and the associated discussion was that there would be a print.trellis
argument that could be used to eliminate the need for with.vpPath
or with.viewport there. I assume that that is what draw.in= in
print.trellis is for. When I try it I get an error. I did notice that
?print.trellis says draw.in=
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)),
2008 Aug 08
2
gridBase and new.page() / grid.newpage()
Hello all,
I'm trying to write a function using the gridBase package. I'd like
to push several base subplots to a larger plot constructed with grid.
However, I'm having trouble getting consistent results when running
the function when the plotting window (quartz) is closed, when it is
left open and the plot function is repeated to the same window, and
when the output is saved to a
2008 Aug 17
1
Making use of names of viewports (grid)
The following code, though not brilliant, works on an A4 page. It
might look odd on other devices of a very different size.
=============X8------- cut here ----------------------------
require(grid)
wide <- 15
vps <- grid.layout(nrow = 3, ncol = 4,
widths = unit(rep(1, 4), rep("null", 4)),
heights = unit(c(99, 1, 99),
2011 Oct 31
1
Help combining cell labelling and multiple mosaic plots
Dear colleagues
I'm using data that looks like .test and .test1 below to draw two mosaic plots with cell labelling (the row percentages from the tables).
When I take out the pop=FALSE commands in the mosaic commands and comment out the two lines labelling the cells, then the plots are laid out exactly as I'd like: side-by-side.
But I do require the cell labelling and the pop=FALSE
2011 Apr 28
2
gridBase Base Plot Positioning
Hello,
I'm trying to follow the documentation of how to use gridBase, and I've reached the minimal code example below as my best effort. Can someone explain how to keep the column of boxplots on the same page as the rectangles (even though I've tried new = TRUE) ? Also, would it be hard / possible to match up the middle of each boxplot to the middle of each rectangle ?
2005 Oct 03
1
Grid: constructing a gTree with grobs that use named viewports from a vpTree
I'm trying to create a layout with named viewports that I can use for
other functions. I create the viewport tree that I want, and a list
of grobs with the viewports describing where they should go.
library(grid)
vp <- vpTree(
viewport(layout=grid.layout(2,2), name="layout"),
children=vpList(
viewport(layout.pos.col = 1, layout.pos.row=1, name="tl"),
2004 Sep 07
1
gridBase and heatmap
I would like to use gridBase to place four separate heatmaps (actually,
a stripped-down heatmap.2 from ght gregmisc package that contains only
the "image" part) into four different viewports. I can get the
placement correct, but I keep 'losing' the previous plot. Any
suggestions?
Here is some quick example code trying to put a heatmap into the left
viewport and then
2004 Sep 23
1
Gridbase basic question
All,
I have a simple plot(x,y) and I would like to then insert rectangles of
some length (in native coordinates) and height fixed to 0.5 in native
coordinates. I can't quite get the code right to do this. Can anyone
give me a quick example of how to do this? I looked the gridBase index
and the tutorial (from R-news?) but just haven't gotten it down yet.
> plot(1:10,1:10)
2012 Oct 19
1
grid(Base): How to avoid "Figure region too small and/or viewport too large" by specifying 'relative' units?
Dear grid-expeRts,
The goal:
I would like to construct a plot (matrix) with grid and gridBase,
which consists of four "sub-plots". The sub-plots should have a square plotting
region as one would force with par(pty="s") in base graphics.
The problem:
I don't get a square plotting region, not even by specifying
pty="s" in par(). Indeed, if you display the grid
2008 Oct 27
3
Arrays of Trellis plots
hello,
the example below does not work. (i know it's not supposed, but it makes it
clear what i'm trying to achieve)
par(mfrow=c(2,1))
xyplot(y~x2|x1,data=dataframe1,pch=20)
xyplot(y~x2|x1,data=dataframe2,pch=20)
i know i could probably merge the two datasets and do something like
xyplot(y~x2|x1+dataset,data=merged)
any other suggestion?
thanks.
[[alternative HTML version deleted]]
2013 Aug 22
1
corrgram (package corrgram): how to plot multiple correlograms in the same page?
Hello,
I am trying to plot a few correlograms on the same figure, with the function corrgram() from the package corrgram. However, the function does not seem to use the base graphic system, as setting out the multiple figure layout with, e.g., par(mfrow=c(2, 2,)) does not work.
Does anybody know a workaround for this?
Many thanks in advance for any advice
best
giuseppe
--
Giuseppe Pagnoni,
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
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
2012 Sep 23
1
Background color in a grid plot seems to interfere with plot()
Hi,
Why does the upper left panel (in the plot below) not have a gray background?
Cheers,
Marius
require(grid)
require(gridBase)
pdf(file="Rplot.pdf", width=8, height=8, onefile=FALSE)
## set up the grid layout
gl <- grid.layout(5, 5, widths=unit(c(1.8, 8, 0.8, 8, 0.8), "cm"),
heights=unit(c(0.8, 8, 0.8, 8, 1.5), "cm"))
if(FALSE) grid.show.layout(gl)
2008 Aug 06
1
grid layout scaling viewport width based solely on height
Hello all,
I'm trying to write a function that produces a main plotting region
with several square plots along the right side. Ideally the size of
right side plots will scale only with the height of the entire plot,
yet never overlap with another secondary plot. The following two
snippets get close, however, as I resize the plot horizontally the
right side plots (green squares) get smaller
2006 Sep 05
4
Two submitted packages
## This example runs in R 2.3.1 and does not run in R 2.4.1. I am
## raising it here for two questions: one on how to debug functions
## inside a namespace, the other on how to control clipping.
tmp <- data.frame(x=1:5, y=1:5, a=factor(c(1,1,1,1,1), levels=1:4))
xyplot(y ~ x,
data=tmp, ylim=c(1.5,4.5),
panel=function(x,y, ...) {
cpv <- current.viewport()
2009 Mar 20
1
Howto Supress Extra Blank Page in gridBase
Dear all,
I have a simple plot using "gridBase" like this.
The problem occurs whenever I execute this code
there is always a blank page created before the actual plot.
How can we disable that blank page?
I am using: R version 2.7.2 (2008-08-25)
and gridBase version: 0.4-3
__ BEGIN__
library(grid)
library(gridBase)
opar <- par(no.readonly=TRUE)
par(opar)
grid.newpage()
2013 Jul 04
2
Modificar una función de un paquete
Estimados miembros de la lista.
Estoy trabajando con la función mosaic del paquete vcd. Cómo puedo hacer
para ver el contenido fe la función y modificar algunos de sus argumentos?
Muchas gracias,
Manuel
--
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola@una.ac.cr