Displaying 20 results from an estimated 10000 matches similar to: "grid graphics gpar(fill) argument and jpeg device"
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 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
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 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),
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
2012 Oct 09
2
plot.new() and grid functions in multipage pdfs
Hi,
when using the grid package, I've come across this weird behaviour
where a call to plot.new() will start a new page for a multi-page pdf,
but then the margins will somehow behave strangely for all but the
first page: here is some code:
pdf("test.pdf"); plot.new(); grid.rect(gp = gpar(fill="blue"));
plot.new(); grid.rect(gp = gpar(fill="blue")); dev.off()
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,
2008 Apr 08
2
diagonally fill a rectangle with color gradient
Hi,
Is it possible to diagonally fill a rectangle with a color gradient? I
noticed that the gradient.rect of plotrix could fill a rect either up and
down or from side to side. I am looking for something similar but fills
diagonally instead, e.g., from the upper left corner to the bottom right.
Does anyone know how to do it in R?
Thanks,
--
Tom
[[alternative HTML version deleted]]
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
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 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
2007 Mar 25
1
controlling panel.width and panel.height in viewports
Dear all,
I'm trying to get a series of lattice levelplots to appear in
viewports in a particular way but struggling to exert fine control
over their appearence. There are two conditions: (a) I only want the
levelplot to appear (I don't want axes, colour key, etc) in the
viewport and (b) I want the levelplot to expand to the maximum
allowable space in the viewport while observing
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,
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
2012 Sep 23
1
Background color in a grid plot seems to interfere with plot()
Hi,
Why does the upper left panel (in the plot below) not have a gray background?
Cheers,
Marius
require(grid)
require(gridBase)
pdf(file="Rplot.pdf", width=8, height=8, onefile=FALSE)
## set up the grid layout
gl <- grid.layout(5, 5, widths=unit(c(1.8, 8, 0.8, 8, 0.8), "cm"),
heights=unit(c(0.8, 8, 0.8, 8, 1.5), "cm"))
if(FALSE) grid.show.layout(gl)
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 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),
2007 Sep 30
1
clipping viewports
Dear useRs,
Why are the rotated blue and yellow boxes in the example below clipped outside of 6 x 6 inch window in the middle of the page?? Where does the 6 x 6 inch window come from? I would like to make use of the entire page.
> library(grid)
> pdf(file = "FarmMaps.pdf", paper = "a4")
> pushViewport(viewport(
+ width = unit(7.6, "inches"), height =
2013 Jul 04
1
Modificar una función de un paquete
Muchas gracias Javier,
Lo que yo quiero es cambiar el título de la leyenda que dice "Pearson
residuals" a español "Residuales de Pearson", pero no me doy cuenta como.
También en lugar de "p-value", que diga "Valor de P". Es posible?
Manuel
2013/7/4 Marcuzzi, Javier Rubén <javier.ruben.marcuzzi@gmail.com>
> Estimado Manuel Spíndola
>
>
2009 Mar 21
1
Forestplot () box size question
Hi All,
I have been able to modify the x-axis to start at zero by adding xlow
and xhigh parameters; that was pretty simple. I have been unable to
find the location of the code that would turn off the information
weighting of the box size (I have smaller randomized trials getting
less weight than a much larger non-randomized trial). The function
is forestplot() from rmeta.
Thanks for any