search for: vptree

Displaying 20 results from an estimated 23 matches for "vptree".

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") ) ) grobs <- gList( rectGrob(vp="tl"), textGrob("Top le...
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 Sep 19
1
Lines between panels in lattice
Hello, I have a multi-page display each consisting of two-panels above each other. I need to draw a line from the top panel to bottom panel. Using current.vpTree() i find that "plot1.panel.1.2.vp" and "plot1.panel.1.1.vp" are the top and bottom ones respectively. I am using the following code(inspired by Paul Murrell's R Graphics) to draw a line. (All the co-ordinates lie well within the ranges of the respective panels) seekVi...
2008 Sep 19
0
Fwd: Lines between panels in lattice
...unif(10),rnorm(10),c(rep(1,5),rep(2,5))) > xyplot(x[,2]~x[,1]|x[,3],layout=c(1,2)) > x > > #x[,3]==2 is in the top panel and x[,3]==1 is in the bottom panel > #so x[6:,] onwards is on the top panel and x[1:5,] is in the bottom > #to find out the names of the viewports, use current.vpTree() > > seekViewport("plot1.panel.1.2.off.vp") > grid.move.to(unit(x[10,1],"native"),unit(x[10,2],"native")) > seekViewport("plot1.panel.1.1.off.vp") > grid > .line > .to > (unit > (x[1,1],"native"),unit(x[1,2],"native&...
2010 Dec 07
2
tableGrob and properties of a cell
...fy gpar() properties of a cell inside tableGrob() output. In the following example I want to have different color for one out of 4 cells require(gridExtra) z<-matrix(1:4,2,2) grid.draw(tableGrob(z)) The only way I found for now how to do it is to do something like this downViewport(current.vpTree()$children[[1]]$children[[6]]$name) grid.text('2',gp=gpar(col='red',fontface='bold')) But for some reasons when I try to print the table into jpeg the last grid.text() prints desired label text somewhere but not in the place I want it to be. Is there another more "smar...
2008 Jan 15
1
navigating ggplot viewports
...here is no obvious problem there. > library(ggplot2) > qplot(1:10, 1:10) > current.viewport() viewport[ROOT] > downViewport("panel_1_1") Error in downViewport.vpPath(vpPathDirect(name), strict, recording = recording) : Viewport 'panel_1_1' was not found > current.vpTree() viewport[ROOT]->(viewport[GRID.VP.1]) > grid.ls(viewports=T, grob=F) ROOT GRID.VP.2 1 GRID.VP.3 layout strip_h_1_1 1 strip_v_1_1 1 axis_h_1_1 1 axis_v_1_1 1 panel_1_1 2 layout panel_1_1 2...
2006 May 21
1
print.trellis(..., draw.in=...)
...eval.parent(substitute(expr)) upViewport(depth) invisible(result) } getChildren.viewport <- function(x) x$children grid.newpage() # specify number of cells to fill and number of rows n <- 5; nr <- 3 nc <- ceiling(n/nr) downViewport(pushLayout(nr, nc)) vpt <- current.vpTree(all = FALSE) for(k in 1:n) print( xyplot(v ~ v, list(v = 1:k)), newpage = FALSE, draw.in = getChildren.viewport(vpt)[[k]] )
2005 Oct 11
1
aligning column of xyplots and removing space between them
...nt(substitute(expr)) upViewport(depth) invisible(result) } grid.newpage() # n and nr are number of cells and rows n <- nr <- 3 nc <- 1 # must be 1 heights <- unit(c(2, rep(1, nr-1)), "null") downViewport(pushLayout(nr, nc, heights = heights)) vpt <- current.vpTree(all = FALSE) ### relevant part starts here ######################### xlab <- main <- function(x) if (x) "v" for(k in 1:n) with(vpt$children[[k]], print( xyplot(v ~ v, list(v = 1:k), xlab = xlab(k == n), xlim = c(0,n), ylim = c(0,n), main = main(k == 1), scales = list(x =...
2008 Aug 17
1
Making use of names of viewports (grid)
...39; (the blue-toned book), I see there's such a thing as vpList which I could make while I'm in that for loop, but I don't see how I could do something like vpL <- c(vpL, cube.k) sort of thing that I could do with a vector. It's even less clear how I could make use of vpStack or vpTree. What is a smarter way to get back to those upper viewports? -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Middle minds discuss events (:_~*~_:) Sma...
2008 Jul 28
1
grid.ls() after grid.remove() fails
...ve) 4: gridList.default(x, grobs = grobs, viewports = viewports, fullNames = fullNames, recursive = recursive) 3: gridList(x, grobs = grobs, viewports = viewports, fullNames = fullNames, recursive = recursive) 2: grid.ls(print = FALSE) 1: str(grid.ls(print = FALSE)) > str(current.vpTree()) List of 17 $ x :Class 'unit' atomic [1:1] 0.5 .. ..- attr(*, "unit")= chr "npc" .. ..- attr(*, "valid.unit")= int 0 $ y :Class 'unit' atomic [1:1] 0.5 .. ..- attr(*, "unit")= chr "npc" .. ..- at...
2005 May 31
2
Problem going back to a viewport with gridBase
I am setting up base plots -- one in viewport A and and one in B. This part works fine. But if I go back to A after having done B and add horizontal lines it seems to not use the correct coordinates. How do I tell it to resume using A's coordinates? I am already using par(fig = gridFIG()) but it seems that that's not enough to reestablish them. What happens is that when I go back to
2005 May 31
2
Problem going back to a viewport with gridBase
I am setting up base plots -- one in viewport A and and one in B. This part works fine. But if I go back to A after having done B and add horizontal lines it seems to not use the correct coordinates. How do I tell it to resume using A's coordinates? I am already using par(fig = gridFIG()) but it seems that that's not enough to reestablish them. What happens is that when I go back to
2010 Oct 29
1
Underline only colnames in grid.table
Dear all, I would like to underline only the colnames in a table as e.g. grid.draw(tableGrob(head(iris, 10), name="test")) I can imagine you should use grid.edit or so, bu I can't figure out how... Does anyone have a suggestion? Thanks Robbert windows xp R 2.10.1 -- View this message in context:
2012 Apr 13
0
Reference Class import() behaviour
...NULL, nums = 1:10) { vps <<- vps gt <<- gt nums <<- nums }, view = function() { print(vps) print(gt) print(nums) })) b.gen <- setRefClass("classB", contains = "classA") library(grid) my.vps <- vpTree(viewport(name = "parent"), vpList(viewport(name = "child"))) my.gtree <- gTree(name = "tree", children = gList(rectGrob(vp = "parent"), textGrob("test", vp = "child")...
2012 Jun 20
2
exact relative positioning of lattice plots
...lot <- xyplot( 1 ~ 1, panel = function () grid.rect(gp = gpar(fill="blue")), scales = list(axs = 'i', draw = FALSE), xlab = NULL, ylab = NULL, par.settings = theme.padding) # Push viewports and print plots grid.newpage() pushViewport( vpTree( viewport(layout = masterLayout, name="master"), vpList(vp1, vp2, vp3))) seekViewport("master") print(myPlot, draw.in = "vp1", panel.height = list(x=2, units="in")) print(myPlot, draw.in = "vp3", panel.height = list(x=3, units="in"...
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::
2009 Jul 21
2
animated grid graphics
I need to make a fairly complex animated graphic and decided to use grid for it. A very simple example of what I need: ##============================================================================== library(grid) grid.newpage() pushViewport(plotViewport()) pushViewport(viewport(xscale = extendrange(c(0, 100)), yscale = extendrange(c(0, 100)))) grid.xaxis() grid.yaxis()
2004 Apr 12
1
R 1.9.0 is release
...- Added upViewport(), downViewport(), and seekViewport() to allow creation and navigation of viewport tree (rather than just viewport stack). - Added id and id.lengths arguments to grid.polygon() to allow multiple polygons within single grid.polygon() call. - Added vpList(), vpStack(), vpTree(), and current.vpTree() to allow creation of viewport "bundles" that may be pushed at once (lists are pushed in parallel, stacks in series). current.vpTree() returns the current viewport tree. - Added vpPath() to allow specification of viewport path in downViewport() and se...
2004 Apr 12
1
R 1.9.0 is release
...- Added upViewport(), downViewport(), and seekViewport() to allow creation and navigation of viewport tree (rather than just viewport stack). - Added id and id.lengths arguments to grid.polygon() to allow multiple polygons within single grid.polygon() call. - Added vpList(), vpStack(), vpTree(), and current.vpTree() to allow creation of viewport "bundles" that may be pushed at once (lists are pushed in parallel, stacks in series). current.vpTree() returns the current viewport tree. - Added vpPath() to allow specification of viewport path in downViewport() and se...
2013 Jul 04
2
Modificar una función de un paquete
Estimados miembros de la lista. Estoy trabajando con la función mosaic del paquete vcd. Cómo puedo hacer para ver el contenido fe la función y modificar algunos de sus argumentos? Muchas gracias, Manuel -- *Manuel Spínola, Ph.D.* Instituto Internacional en Conservación y Manejo de Vida Silvestre Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA mspinola@una.ac.cr