similar to: ggplot2: Changes to grobs not saved to file output

Displaying 20 results from an estimated 700 matches similar to: "ggplot2: Changes to grobs not saved to file output"

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
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 to write a syntactically correct gPath), p
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
2005 Feb 18
1
Examples of multiple key grobs
The xyplot help page gives quite a lot of information 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
2008 Aug 14
1
ggplot2: remove minor-horizontal guide before drawing
Hi, I want to remove minor-horizontal and minor-vertical lines from a plot generated with ggplot2. I can do this after the plot has been drawn using grid.gremove. However, I would like to do it before drawing my plot. The ggplot2 book refers to a ggplotGrob function which creates a grob from a plot but this function doesn't seem to exist in ggplot2 0.6. Is there another way to do it?
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().
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) >
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"),
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)
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
2009 Jan 19
1
Floating point excepting when cbind()ing a matrix of grobs (or environments) with a 0-column matrix
library(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/
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
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,
2011 Nov 15
1
grid.arrange, grid.layout - legend, global y axis title
Hello, I created several plot with ggplot2 dev mode. Now I want to combine the plots in a grid e.g. 2x2 with a fixed size of the output. What I am doing at the moment is: grid.newpage() pushViewport(viewport(layout = grid.layout(nrow=2, ncol=2, widths = unit(c(7.5,6.5), "cm"), heights = unit(rep(5, 2), "cm")))) print(plot1, vp = viewport(layout.pos.row = 1,
2004 Nov 21
1
Location of grobs etc on lattice output
Is there any way, after use of print.trellis(), to obtain the co-ordinates of the plot region, e.g., in what are then the native co-ordinates? e.g. library(DAAG) library(lattice); library(grid) data(cuckoos) pushViewport(viewport(layout=grid.layout(2, 1))) pushViewport(viewport(layout.pos.row=1)) cuckoos.strip <- stripplot(species ~ length, data=cuckoos) print(cuckoos.strip,
2005 Nov 02
0
Placing a grob in multiple viewports
Hi all, What's the best way of placing a grob into muliple viewports? I've been using code like: plot_grob_matrix <- function(gm, type=deparse(substitute(gm))) { grid <- 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) {
2012 Aug 07
1
Styling gridExtra's title and left labels
Hi, I'm using the gridExtra package to combine some graphs like in the arrangeGrob example. Each of the graphs has a title but they appear much larger than the overall combined plot title and left axis label. Does anyone know how I can control the style / size of the gridExtra labels? library(gridExtra) library(ggplot2) dsamp <- diamonds[sample(nrow(diamonds), 1000), ] p1 <-
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