Displaying 20 results from an estimated 400 matches similar to: "puzzle with drawDetails for a class derived from a gTree"
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"),
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
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))
##
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 <-
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
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,
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)
>
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
2011 Sep 30
0
Warning messages upon new package loading
Dear R-users,
The following warning messages are displayed when I require a new package
that I am currently developing. Everything seems to work just fine though,
so I am wondering how to get rid of the warnings.
Warning messages:
1: Class "frame" is defined (with package slot 'kiwixposepreprod') but no
metadata object found to revise superClass information---not exported?
2007 Aug 08
1
Help using gPath
Hi everyone,I'm trying to figure out how to use gPath and the documentation
is not very helpful :(
I have the following plot object:
plot-surrounds::
background
plot.gTree.378::
background
guide.gTree.355:: (background.rect.345, minor-horizontal.segments.347,
minor-vertical.segments.349, major-horizontal.segments.351,
major-vertical.segments.353)
guide.gTree.356::
2011 Apr 26
2
grid stringHeight
Dear all,
I'm puzzled by the behavior of stringHeight in the grid package.
Consider the following test,
library(grid)
test <- function(lab="dog", ...){
g1 <- textGrob(lab)
g2 <- rectGrob(height=grobHeight(g1), width=grobWidth(g1))
gg <- gTree(children=gList(g1,g2), ...)
print(c("height:", convertUnit(stringHeight(lab), "mm",
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 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)
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,
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:
2009 Jun 04
0
type = 'b' with Grid
Dear all,
I feel like I've been reinventing the wheel with this code (implementing
type = 'b' for Grid graphics),
http://econum.umh.ac.be/rwiki/doku.php?id=tips:graphics-grid:linesandpointsgrob
Has anyone here attempted this with success before? I found suggestions
of overlapping large white points to mask the lines but it's not ideal.
I welcome any comments on the code.
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,