Displaying 20 results from an estimated 1000 matches similar to: "Placing a grob in multiple viewports"
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"),
2005 Oct 03
2
grob questions
If I run the following example from:
http://www.stat.auckland.ac.nz/~paul/grid/doc/grobs.pdf
> grid.newpage()
> pushViewport(viewport(w = 0.5, h = 0.5))
> myplot <- gTree(name = "myplot", children = gList(rectGrob(name = "box",
+ gp = gpar(col = "grey")), xaxisGrob(name = "xaxis")))
> grid.draw(myplot)
>
2009 Jun 26
1
gradient fill of a grid.polygon
Dear list,
Following a recent enquiry, I've been playing with the idea of creating a
colour gradient for a polygon, using the Grid package. The idea is to draw a
number of stripes of different colours, using the grid.clip function. Below
is my current attempt at this,
library(grid)
rotate.polygon <- function(g, angle=0){ # utility function, works fine
matR <- matrix(c(cos(angle),
2008 Jan 15
1
navigating ggplot viewports
list(...)
I can not get at the grid viewports in a ggplot2 plot.
I know there is supposed to be a viewport called "panel_1_1" but
downViewport() can't find it. Has the viewport been popped?
I had a quick look at the functions involved (eg ggplot_plot)
but there is no obvious problem there.
> library(ggplot2)
> qplot(1:10, 1:10)
> current.viewport()
viewport[ROOT]
>
2009 Sep 19
1
matrix operations on grobs and grid units
Dear list,
As a minimal test of a more complex grid layout, I'm trying to find a
clean and efficient way to arrange text grobs in a rectangular layout.
The labels may be expressions, or text with a fontsize different of
the default, which means that the cell sizes should probably be
calculated using grobWidth() and grobHeight() as opposed to simpler
stringWidth() and stringHeight().
2012 Apr 13
0
Reference Class import() behaviour
Dear All,
In a project I've been working on we've been using Reference Classes
and grid extensively. However, something that I have come across is
that when using the import() method on refclass objects, it does not
work as expected with grid grobs and viewports.
I have prepared test cases that illustrate the point but the general
idea is that importing appears to work fine for
2004 Apr 12
1
R 1.9.0 is release
I've rolled up R-1.9.0.tgz a short while ago. This is a new version
with a number of new features, most notably a substantial
reorganization of the standard packages, a major update of the grid
package, and the fact that underscore can now be used as a regular
character in variable names. See below for further changes.
Because of the disturbances at the machine that hosted the CVS
archives,
2004 Apr 12
1
R 1.9.0 is release
I've rolled up R-1.9.0.tgz a short while ago. This is a new version
with a number of new features, most notably a substantial
reorganization of the standard packages, a major update of the grid
package, and the fact that underscore can now be used as a regular
character in variable names. See below for further changes.
Because of the disturbances at the machine that hosted the CVS
archives,
2012 May 22
2
package grid: mirror grob objects along an axis
Hi everyone
I'd like to flip grobs (grid graphical objects) along an axis, e.g. flip grobs
horizontally or vertically. I couldn't find any hints, neither in the
documentation nor by searching the web. Does anybody know how to achieve this?
Cheers
/thomas
2008 Jul 09
1
childNames for xaxis grob (grid package)
Dear list,
Can someone explain why the childNames below
gives
character(0)
instead of the (canonical) names of the children grobs
of the xaxis gTree ?
[1] "major" "ticks" "labels"
Many thanks in advance,
Tobias
### minimal example code ###
library(grid)
pushViewport(plotViewport(c(5,4,4,2)))
pushViewport(dataViewport(1:5, 1:5))
grid.points(1:5, 1:5)
2010 Mar 19
2
lattice grob
Dear list,
I'm trying to arrange various grid objects on a page using a
frameGrob. It works fine with basic grobs (textGrob, gTree, etc.), and
also with ggplot2 objects using the ggplotGrob() function. I am
however stuck with lattice. As far as I understand, lattice produces a
list of class trellis, which is eventually displayed using the
plot.trellis method. I am not sure if/how one can
2011 Feb 15
1
gList and gTree methods of grid::grobX
Dear all,
In an attempt to draw fill patterns in grid graphics, I have
encountered a behavior of grobX that I cannot understand from the
documentation. Consider this,
library(grid)
## gTree
g1 <- gTree(children=gList(
rectGrob(0.5,0.5, width=unit(0.8,"npc"),
height=unit(2,"cm")),
circleGrob(r=0.3)), vp=viewport(0.5,0.5))
##
2010 Jun 16
0
replicate a grob n times
Dear all,
I use the following to create a list of identical grobs,
require(grid)
rep.grob <- function(g, n){
replicate(n, g, simplify=FALSE)
}
This approach suffers two problems:
1- R CMD check is not happy about the S3-like name. How can / Should I
make this a real S3 method?
2- I don't know if this is the most efficient way to do it.
Suggestions are welcome.
Regards,
baptiste
2007 Dec 26
1
seekViewport error
Why does the seekViewport at the bottom give an error?
> xyplot(Sepal.Length ~ Sepal.Width, iris, group = Species, col = 11:13,
+ auto.key = TRUE)
> grid.ls(view = TRUE)
ROOT
GRID.rect.89
plot1.toplevel.vp
plot1.xlab.vp
plot1.xlab
1
plot1.ylab.vp
plot1.ylab
1
plot1.strip.1.1.off.vp
GRID.segments.90
1
plot1.strip.left.1.1.off.vp
2008 Jul 28
1
grid.ls() after grid.remove() fails
Dr Murrell and others,
It seems grid.ls() fails after any use of grid.remove(). It gives an
infinite recursion error even in the simplest cases, and no matter
what arguments are passed to grid.ls.
> library(grid)
> grid.newpage()
> grid.lines(name="foo")
> grid.ls()
foo
> grid.remove("foo")
> grid.ls()
Error: evaluation nested too deeply: infinite recursion
2003 May 12
3
grid - deleting and erasing grobs?
Hello!
Don't quite understand how can I delete grobs and simultaneously erase
graphic output they produce. I first change grob's "vp" field to null
(grid.edit(gr,vp=NULL)) to erase it and then call rm(gr) (as grobs are
external pointers I'm not shure what this method actually frees
allocated memory).
May be there is simpler method?
Does garbage collector have any effect
2003 May 12
3
grid - deleting and erasing grobs?
Hello!
Don't quite understand how can I delete grobs and simultaneously erase
graphic output they produce. I first change grob's "vp" field to null
(grid.edit(gr,vp=NULL)) to erase it and then call rm(gr) (as grobs are
external pointers I'm not shure what this method actually frees
allocated memory).
May be there is simpler method?
Does garbage collector have any effect
2008 Sep 29
2
ggplot 2 - editing in the "panel_1_1" viewport
Hi All,
I am trying to find out how to access the components of a ggplot plot, and I
found this reply from Paul Murrel
http://www.nabble.com/navigating-ggplot-viewports-tt14826352.html#a15056223.
I tried it, and it works.
However, I am trying to develop some functions that will do the drawing
"automatically", and usually I will not know the full name of the grob that
has the layout vp,
2009 Sep 27
0
puzzle with drawDetails for a class derived from a gTree
Dear all,
I've tried all sorts of variations discussed in "R graphics" by Paul
Murrell, but I still can't understand how to write a drawDetails
method for a class derived from a gTree.
Below is a minimal, dummy example where two strings are plotted in two
separate viewports. I require the creation of the strings to be
evaluated inside the drawDetails function because my real
2017 Jun 16
2
Varios gráficos en una vista en OpenAir
Hola Carlos,
Me parece que timePlot genera los gráficos en un formato diferente.
Al ejecutar grid.arrange genera el siguiente error:
Error in gList(list(list(plot = list(formula = value ~ date | default, :
only 'grobs' allowed in "gList"
Gracias.
Atte.
Novvier Uscuchagua
De: Carlos Ortega [mailto:cof en qualityexcellence.es]
Enviado el: viernes, 16 de junio de 2017 12:38