Displaying 20 results from an estimated 1000 matches similar to: "How to fill irregular polygons with patterns?"
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
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",
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),
2006 Aug 01
1
R crashes using pdf() windows() or postscript()
Dear HelpeRs,
I have a script where I save several thousands of graphics. These are
then used in Latex through Sweave. Unfortunately R crashes while making
these plots and Windows pops up some message that I run low on virtual
memory. I tried to save the plots using pdf(), windows() and
postscript() and also tried to run it with R CMD BATCH myscript.R. But
after a while R slows down and crashes
2010 Apr 17
2
grid.cap() requires more time?
Dear all,
I am puzzled by the following behavior of the new grid.cap() function,
which appears to run out of time when capturing the output of a
graphic. It works fine if I introduce a Sys.sleep(1) before executing
more code,
library(grid)
quartz()
grid.circle(gp=gpar(fill="black"))
gg <- grid.cap()
dev.new()
grid.raster(gg) ## completely blank
gg[gg!="white"] ## indeed
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 Dec 04
1
Apparent different in symbol scaling between xyplot and grid.points
Dear R-users,
For the past few days, I have been trying to find the reason why some of
my plots were showing symbols of different sizes, while I thought I was
using the same .cex arguments everywhere. The problem is exemplified by
the following example code where the xyplot and grid.points functions
are used. The scaling factor is set to 0.84 in both the functions
settings, but one can see
2007 Dec 10
2
Viewport and grid.draw
Hi Deepayan and everyone,
I need to add a common legend to a group of latice
graphs, I have tried different ways using viewport and
grid.draw without success.
Here is what I have:
plot.new()
library(grid)
library('IDPmisc')
print(plot1, split=c(1,1,2,4), more=TRUE)
print(plot4, split=c(2,1,2,4), more=TRUE)
print(plot2, split=c(1,2,2,4), more=TRUE)
print(plot5, split=c(2,2,2,4),
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
2007 Sep 13
1
minimize white space around lattice plot
Dear list,
I'm trying to produce a plot via xyplot with minimal sourounding white
space. However, I cannot find the options in xyplot, ps.options or
wherever which prevents lattice from drawing quite some white space
around my plot. However, this is quite a problem for me as I want to
produce an inset plot inside another lattice-plot. I'm using the panel
function to open a viewport and
2009 Sep 28
2
dichromat, regexp, and grid objects
Dear list,
The dichromat package defines a dichromat function which "Collapses
red-green color distinctions to approximate the effect of the two
common forms of red-green colour blindness, protanopia and
deuteranopia."
library(dichromat)
library(grid)
colorStrip <-
function (colors = 1:3, draw = TRUE)
{
x <- seq(0, 1 - 1/length(colors), length = length(colors))
y <-
2005 Oct 18
2
Lattice graphics strip labels for shingles
Dear all,
back in 2002 Martin Henry H. Stevens wrote
(https://stat.ethz.ch/pipermail/r-help/2002-May/019851.html)
> How do I control the text in strips? Specifically, I want to put in the
> ranges generated in shingle(x) where x is continuous.
with an answer from Deepyan Sarkar (see strip.new towards the end of this
message). I assume that the answer worked back then, but I've tried
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
2002 Oct 09
1
Large F-value and small P-value
Hi all,
I computed a Wilks Lambda Test with manova:
> df.man <- manova(df.mul ~ 1, na.rm=TRUE)
> summary(df.man, intercep=T, test="Wilks")
Df Wilks approx F num Df den Df Pr(>F)
(Intercept) 1 0.0002824 393.3 9 1 0.03911 *
Residuals 9
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*'
2009 Dec 03
2
Passing arguments to gpar
Dear R-users,
I would like to know how to pass arguments to gpar() without hard-coding
them. I tried to store my arguments in a list and passed this list to
gpar(), but it did find the way to do it properly. Any help would be
appreciated.
a<- list(fontisze=8,col=3)
gpar(fontsize=8,col=3)
gpar(a)
gpar(unlist(a))
2007 Jul 24
1
How to add circular text for a graph with concentric circles
Dear R experts,
I am plotting the population of students who live in a city, and in
successive circular bands made of the contiguous districts that surround
the city. This is a stylized figure, where I specify the area of each
successive circle based on the cumulative population of students. I want
to compare two sets of concentric circles across different populations -
such as 'All
2013 Feb 14
1
Alternate tick labels in xyplot
Dear Rhelp,
I would like to get alternate tick labels for the xyplot:
library(lattice)
library(grid)
xy <-xyplot(decrease ~ treatment, OrchardSprays,
??? main= "Some plot",
??????? groups = rowpos, type = "a",
??? ??????????? page???? = function(n){
???????????????????????? grid.text(LETTERS[j],
???????????????????????? y = 0.95,
???????????????????????? x = 0.15,
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"))
2012 Sep 24
1
Question lattice SplomT
Dear Deepayan Sarkar,
I have (again) a question concerning "panel" and my function "SplomT",
see attachments. Some time ago you helped me to write this function,
thanks again. I have used it to great advantage in my statistics
instructions. Now the problem I encounter is that the .pdf figure
generated in Sweave consists of
one extra empty page at the start.
This prevents
2005 Jan 19
1
Should NEVER happen; please bug.report() [mkCLOSXP] (PR#7535)
I'm probably not using the function right, but anyway, the program said:
"please bug.report."
> w_R.f1=function(PR,Pc) return (Pc*PR^3)
>
> w_R.f2=function(PR,Pc) return (Pc*PR)
>
> w_R.fc=c(w_R.f1,w_R.f2)
> w_R.fc[2]
[[1]]
function(PR,Pc) return (Pc*PR)
>
> RSD(type=3,
+ gparP=gpar(col="red"),
+ gparD=gpar(fill=FALSE,col=FALSE),
+