similar to: plot.new() and grid functions in multipage pdfs

Displaying 20 results from an estimated 8000 matches similar to: "plot.new() and grid functions in multipage pdfs"

2005 Dec 08
1
grid graphics gpar(fill) argument and jpeg device
Hi everybody, I just notice a strange behaviour of gpar's fill argument when using non-postscript devices: The default of the argument is transparent (according to get.gpar("fill")). So as expected, the following code draws a nice red rectangle in the middle of my X11 or postscript device. pushViewport(viewport(width=0.5, height=0.5)) grid.rect(gp=gpar(fill="red"))
2004 Jun 28
1
text length in grid
Hello! I first would like to compliment the authors of grid on what has been a wonderfully useful package for me. Now, my question: Is there any way I can specify the size of some grid.text using grid units? I must label the regions of a plot. The regions can be either very small or very large, so I would like to label each by fitting its text to the size of the region in question. Ideally, I
2008 Mar 04
1
grid.layout?
platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 2 minor 6.2 year 2008 month 02 day
2010 Oct 01
2
strange interaction between rasterImage and Grid graphics
Dear all, This may be specific to Mac, I haven't had a chance to test another platform. Consider this, plot(1,1,t="n") rasterImage(matrix(1),1,1,1,1) library(grid) grid.rect(gp=gpar(fill="grey")) The grid.rect covers the full device window as expected. However, when I resize the window ever so slightly (interactive device) the rectGrob is suddenly clipped to the previous
2006 Jul 29
3
placing rectangle behind plot
I am trying to create a lattice plot and would like to later, i.e. after the plot is drawn, add a grey rectangle behind a portion of it. The following works except that the rectrangle is on top of and obscures a portion of the chart. I also tried adding col = "transparent" to the gpar list but that did not help -- I am on windows and perhaps the windows device does not support
2008 Aug 17
1
Making use of names of viewports (grid)
The following code, though not brilliant, works on an A4 page. It might look odd on other devices of a very different size. =============X8------- cut here ---------------------------- require(grid) wide <- 15 vps <- grid.layout(nrow = 3, ncol = 4, widths = unit(rep(1, 4), rep("null", 4)), heights = unit(c(99, 1, 99),
2010 Oct 20
1
need for speed on grid.rect
When I use grid.rect to print a multi-coloured grid, it is incredibly slow compared to a single colour grid, or even a two colour grid. I've set out some simplified examples below. This is something I run literally thousands of times a day, so I would greatly appreciate any hints on how I might improve the speed??? library(grid) pushViewport(viewport( width = unit(100,
2020 May 19
2
Graphic parameters with length zero in grid cause R to crash
Hi, I found in grid package, if the graphic parameters have zero length, R crashes. In the following code, I only tested `grid.rect()` and the `fill` parameter, but I think it should be similar as other grid graphic functions. In `gpar()` function, the graphic parameters are not allowed to have zero length, but we can make them with zero length by first generating a `gpar` object and then
2010 Aug 04
1
gpar fill and transparency on devices
Dear list, I'm puzzled by the graphical output in the following example, library(grid) foo <- function(){ grid.rect(gp=gpar(fill="black")) print(get.gpar()$fill) grid.rect(width=0.2,height=0.2) } png("test.png", bg = "transparent") foo() dev.off() png("test1.png", bg = "white") foo() dev.off() It seems that the default value of
2008 Aug 06
1
grid layout scaling viewport width based solely on height
Hello all, I'm trying to write a function that produces a main plotting region with several square plots along the right side. Ideally the size of right side plots will scale only with the height of the entire plot, yet never overlap with another secondary plot. The following two snippets get close, however, as I resize the plot horizontally the right side plots (green squares) get smaller
2008 Aug 08
2
gridBase and new.page() / grid.newpage()
Hello all, I'm trying to write a function using the gridBase package. I'd like to push several base subplots to a larger plot constructed with grid. However, I'm having trouble getting consistent results when running the function when the plotting window (quartz) is closed, when it is left open and the plot function is repeated to the same window, and when the output is saved to a
2005 Mar 17
1
Varying grid.rect in different panels of a Lattice plot
Dear r-help, Sleep-deprivation from having 2 youngsters under 2 around the house is fuzzing my brain, so please be gentle if the answer to this query is obvious! In the example below, I'm trying to use grid.rect to add grey rectangles to the panels of a lattice plot to indicate which months spawning occurred of a (very cute) native Tasmanian fish. The fish in the two lakes spawned at
2010 Mar 12
2
Redirect/pipe output to less
I'm using R under Linux. Since the help function in R can use the program less to display text, I'd like to know if it is possible for a user to do the same. It would be very helpful to be able to view large objects (matrices/dataframes etc) using less. This is preferable to redirecting output to file or to clutter the workspace with too much output. I have tried to use functions pipe and
2011 Aug 12
1
Grid unit width and font face
Dear R-users, When one defines a grid unit object using the 'strwidth' dimension, it seems that the default plain font is assumed as the following example illustrates. Is there a way to either make use of a font option when creating a unit object or to know the factor that exists between the width of the same text printed in plain and in bold? This might be dependent on the font,
2007 Sep 17
1
side bars on dendrograms with latticeExtra
Dear all, I am using the heatmap representations of latticeExtra package and I would be interested to draw color side bars representing the groups of a factor of interest. From my understanding of : > help(dendrogramGrob) ... The 'add' argument can be used for additional annotation at the base of the dendrogram. It should be a list with one component for each row,
2009 Jun 24
1
parallel rotated strips with color gradient
Hi, I want to produce two parallel rotated strips with color gradient. So far, the sample strip is something produced by this: pushViewport(viewport(x = unit(0.638, "npc"), y =unit(0.386, "npc"), width=.62, height=0.006, angle=137.2)) grid.rect(y=100:1/100, just="top", gp=gpar(col=NA, fill=colorRampPalette(c("lightgray",
2010 Nov 20
1
Grid newbie: aligning & scaling viewports
Oh Knowledgeable Ones: I'm working on a project using grid graphics (for the first time). A toy example is given below, run it simply with >foobar() I am wondering why the pink dot and concentric circles are not centered on the 3-color axis system. Further, I feel like the concentric circles don't have the intended radius - if my math is right, the outmost circle should touch the
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().
2011 Nov 10
1
grid.pack and grid.frame bewilder me
Hello R friends, I get quite confused in using the grid graphic function grid.pack( ) and grid.frame ( ). Here is a simple example: library(grid) grid.frame(name="frame1") grid.pack("frame1",rectGrob(width=unit(0.5,"npc"), height=unit(0.5,"npc"), gp=gpar(col="red"))) what I expect is a rectangle with half the default device's
2012 Sep 27
1
Problem with grid.rect
I have a stupid problem that is currently driving me crazy... Let us suppose that I want to draw a big red square in the middle of my current device (say X11) I tried the following code : pushViewport(viewport(xscale=c(0,1), yscale=c(0,1)), just=c("center", "center")) vp1 <- viewport(x=unit(0.5, "native"), y=unit(0.5, "native"), width=unit(0.4,