similar to: lattice grob

Displaying 20 results from an estimated 300 matches similar to: "lattice grob"

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().
2009 Dec 20
1
basic proto question
Dear list, I made the following example of a proto object that contains some data and a spline interpolation. I don't understand why test$predict() fails with this error message: Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Best regards, baptiste test <- proto(source = data.frame(x=1:10, y=rnorm(10)), raw = function(.){
2005 Apr 14
2
Legend in xyplot two columns
Dear R-Help I have some trouble to set the legend in a xyplot into two rows. The code below gives me the legend in the layout I am looking for, I just rather have it in two rows. library(lattice) schluessel <- list( points=list( col="red", pch=19, cex=0.5 ), text=list(lab="John"), lines=list(col="blue"),
2008 Sep 27
2
multiple plots - editing ggplot2 plot
Hi All, I am trying to build a composite plot, with multiple categories, using ggplot2. In principle, it could be done using facetting, but I do not seem to be able to get past the defaults, so I try building each plot separately, then putting them all together using frameGrob and placeGrob. For this, I need to know how to: 1) format the legend with a different layout (e.g 2 rows by 2 columns,
2007 May 26
1
lattice: aligning independent graphs
I find myself wanting to plot three graphs side by side 'as if' they were panels -- that is, with the same y-axis limits, no space between the graphs, and precise vertical alignment of the plot areas. However, I don't want strip titles; I want each graph to have its own x-axis label, on the bottom of the plot. The best way I have so far found to do this is to fake up a data frame that
2008 Aug 29
1
ggplot2: Changes to grobs not saved to file output
Hello, Maybe I missed something - most likely .:-( I create a gplot and then makes some 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:
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 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) {
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)
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
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
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
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
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
2013 Mar 20
0
How to avoid using gridextra via Depends instead of Imports in a package ?
Hello, I really need some insight on a problem we encountered using grid, lattice and gridExtra. I tried to reduce the problem, so the plot make no sense. we have a package: gridextrabug with: DESCRIPTION ------------------ Package: gridextrabug Title: gridextrabug Version: 0.1 Author: toto Maintainer: toto <karl.forner at quartzbio.com> Description: gridextrabug Imports: grid,
2012 Mar 16
1
ggmap crash
Not sure if this is the right place to report this, but: Am using ggmap to generate a map of a bounding box from 161 latitude/longitude pairs and the code crashes R (in ess). Data is at http://analysis.d8u.us/~hdiwan/plotSource.csv and the code to read it is below. I'm not sure if ess, emacs, ggmap, R, or my laptop is to blame. Here's the code: > rmc <-
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?
2008 Feb 05
2
Error in grid.text after tcltk package loaded
Hello - I am noticing some strange errors when using the grid package, but (apparently) only after loading the tcltk package. The interaction here does not make sense to me, and I'm wondering if anyone else can reproduce this, or if it is specific to my setup. Here is my sessionInfo: sessionInfo() R version 2.6.2 RC (2008-02-04 r44332) i686-pc-linux-gnu locale:
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