Displaying 20 results from an estimated 137 matches for "grobs".
Did you mean:
grabs
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 meth...
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 meth...
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)
> grid.edit("myplot:...
2009 May 31
2
grid.edit() for ggplot2
Dear all,
I'm trying to access and modify grobs in a ggplot2 plot. The basic
idea for raw Grid objects I understand from Paul Murrell's R graphics
book, or this page of examples,
http://www.stat.auckland.ac.nz/~paul/grid/copygrob/copygrobs.R
However I can't figure out how to apply this to a ggplot (basically I
don't know how...
2005 Feb 18
1
Examples of multiple key grobs
...how to use key
and indicates that legend needs to be used if multiple keys are
needed. However, it gives only a brief description of what the grob
needs to contain to do multiple keys.
I've only used the occasional grid function in panel functions, so I
don't have much of a sense of how grobs are constructed. I've been
unable to find examples of code used to do multiple keys and would
appreciate being pointed in the direction of some.
TIA
--
Patrick Connolly
HortResearch
Mt Albert
Auckland
New Zealand
Ph: +64-9 815 4200 x 7188
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~...
2008 Jul 28
1
grid.ls() after grid.remove() fails
...e recursion / options(expressions=)?
> str(grid.ls(print=FALSE))
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
> traceback()
...etc...
...etc...
...etc...
13: gridList.default(X[[2L]], ...)
12: FUN(X[[2L]], ...)
11: lapply(display.list[1:dl.index], gridList, grobs = grobs,
viewports = viewports,
fullNames = fullNames, recursive = recursive)
10: gridList.default(X[[2L]], ...)
9: FUN(X[[2L]], ...)
8: lapply(display.list[1:dl.index], gridList, grobs = grobs, viewports
= viewports,
fullNames = fullNames, recursive = recursive)
7: gridList.default(...
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"),
viewport(layout.pos.col = 2, layout.pos.row=2, name="br&qu...
2008 Aug 29
1
ggplot2: Changes to grobs not saved to file output
...me changes to the plot using grid graphics
functions. These changes show up on the display OK, but when I save using
ggsave() the grid changes do not show up. How do I save the plot with these
changes?
Thanks in advance.
--
View this message in context: http://www.nabble.com/ggplot2%3A-Changes-to-grobs-not-saved-to-file-output-tp19220492p19220492.html
Sent from the R help mailing list archive at Nabble.com.
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(). (Correct?).
The input of this function...
2011 Jul 27
2
Creating a flat legend 'grob' for lattice xyplot
Hi,
I want my xyplot legend to be flat, not tall, and there seems to be no way
for xyplot's auto.key and key elements to do this: I tried many, many
permutations of what I could find in the archives and reading the
documentation. If there there's a way to make it flat, please tell me what
the magic incantation is.
Here's a simple example of what I like to see. The xyplot will be a
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
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 convert this list
into...
2005 Nov 02
0
Placing a grob in multiple viewports
...d <- expand.grid(x=1:nrow(gm), y=1:ncol(gm))
do.call(gList,mapply(function(x,y) editGrob(gm[[x,y]], vp=vp_path(x,
y, type)), grid$x, grid$y, SIMPLIFY=FALSE))
}
vp_path <- function(row, col, type) {
vpPath("layout", paste(type, row, col, sep="_"))
}
to place a matrix of grobs into a similar looking matrix of viewports
(constructed by another function). This works fine if the matrix
contains different grobs, but only draws one if they are all the same
(obviously due to the copy by reference nature of grobs). What's a
better way of doing this? Most of the time the g...
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)
grid.xaxis(name = "xa")
grid.ge...
2007 Dec 18
1
ggplot2 - getting at the grobs
Dear All,
I continue trying to get several of my plotting functions to use
ggplot, because I really do like the concept of the graphical
objects, and working with them in the abstract.
I am now trying to access the grobs to manipulate using grid.
However, until now all I managed was to get the plot as a gTree
object, and manipulate it as a gTree from there. The problem is that
then it is no longer a ggplot, and thus I can no longer use the
ggplot functions.
How to get at the grobs, without converting the ggplot...
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 Jan 19
1
Floating point excepting when cbind()ing a matrix of grobs (or environments) with a 0-column matrix
...ry(grid)
e <- rectGrob()
# OR:
# e <- environment()
a <- matrix(list(e), ncol = 1, nrow = 2)
b <- matrix(ncol = 0, nrow = 2)
cbind(a, b)
cbind(a, b)
This reliably crashes R for me.
I realise this is a rather esoteric error condition, but it crops up
for me when creating matrices of grobs to be turned into a ggplot2
plot.
Hadley
--
http://had.co.nz/
2005 Oct 15
2
grid.edit problem
I am having a problem in editing a grob. It works ok if I try to
shift the grob using npc coordinates but if I do the same thing
using native coordinates the grob disappears. What is wrong?
library(grid)
grid.newpage()
# create viewport
pushViewport(viewport(xscale = c(100,200), name = "X"))
# draw vertical line
grid.lines(150, 0:1, default.units = "native", name =
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 ar...
2009 Sep 28
2
dichromat, regexp, and grid objects
Dear list,
The dichromat package defines a dichromat function which "Collapses
red-green color distinctions to approximate the effect of the two
common forms of red-green colour blindness, protanopia and
deuteranopia."
library(dichromat)
library(grid)
colorStrip <-
function (colors = 1:3, draw = TRUE)
{
x <- seq(0, 1 - 1/length(colors), length = length(colors))
y <-