Displaying 20 results from an estimated 20000 matches similar to: "color area between two time-series via polygon()?"
2006 Jun 07
1
Fw: Help needed using lattice for area plots lpolygon, xyplot.
I am trying to learn how to use the graphics from the lattice package (
and am very new to R).
I am trying to replicate the example plot referenced below, by using the
lattice xyplot & lpolygon to create panels. I get what appears to be the
correct shape of the filled region, but cannot get the position to overlay
properly. I have attempted with various settings of position. ( i.e.
2004 Apr 20
2
polygon
Dear all
In order to clearly mark values wich are larger than a treshold value, I
would like to color the surface below the line given by plot (yy~xx). To
color is only the surface between abline (treshold) and yy if they are
larger than the specific limit. I guess I can use the function polygon,
but I can not find any valuable solution.
I'm grateful to you for an advice or an example.
2008 Aug 15
6
continuous coloring of a polygon
R2.7.1, WinXP
Hi,
I have a polygon inside a circle as follows:
radius <- 3
x <- seq(-radius,radius,length=2000)
y <- sqrt(radius^2-x^2)
xx <- c(x,-x)
yy <- c(y,-y)
plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l",
ylab="", xlab="", axes=F)
radius <- 2.7
x1 <- seq(-radius,radius,length=2000)
y1 <- sqrt(radius^2-x1^2)
2006 Jun 07
0
Help needed using lattice for area plots lpolygon, xyplot.
I am trying to learn how to use the graphics from the lattice package (
and am very new to R).
I am trying to replicate the example plot referenced below, by using the
lattice xyplot & lpolygon to create panels. I get what appears to be the
correct shape of the filled region, but cannot get the position to overlay
properly. I have attempted with various settings of position. ( i.e.
2011 Jun 16
2
Polygon question
Hi all,
I have the following script which fills the values which are less than
the mean of a given timeseries.
If you look closely, the colored regions are "out of line".
Any suggestions how I can rectify this?
Thanks
Muhammad
# -----
#rm(list=ls())
x <- abs(rnorm(100))
tt <- 1:100
m <- mean(x)
w <- which(x>=m)
x1 <- x ; x2 <- x ; x3 <- x
x1[w] <- m
2009 Jun 25
3
grid.polygon() + color gradient
Hi,
I wonder whether there is a way to generate a polygon (a triangle in
my case) with color gradient using grid.polygon() in package grid?
I tried something like
library(grid)
grid.polygon(x=c(0, 0.5, 1), y=c(0.5, 1, 0.5), gp=gpar(col=NA,
fill=colorRampPalette(c("green", "lightgray"),
space="Lab")(200)))
But am only
2009 Mar 13
1
malformed plot symbols in lattice pdf
Hi,
I'm using panel.polygon inside a custom panel function to generate
filled polygons for an xyplot. Everything is as expected until I
specify a value < 1 for alpha to fill with a semi-transparent color
and output to pdf. The plot symbols appear malformed. Am I doing
something wrong here?
Thanks,
Mark
Here is an example (pdfs are attached):
library(lattice)
## example data
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list,
I am not sure if this request is a "ticket" that should be filled somewhere
outside the mailing list. If so, I apologize for not doing and would like
to know where I should have filled it.
And to the subject matter:
I would like to use a command like this:
plot(c(1,8), 1:2, type="n")
polygon(1:7, c(2,1,2,NA,2,1,2),
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list,
I am not sure if this request is a "ticket" that should be filled somewhere
outside the mailing list. If so, I apologize for not doing and would like
to know where I should have filled it.
And to the subject matter:
I would like to use a command like this:
plot(c(1,8), 1:2, type="n")
polygon(1:7, c(2,1,2,NA,2,1,2),
2007 Oct 30
1
Polygon shading line colors
Hi there,
I'm having trouble working out how to change the colors of polygon
shading lines. If I plot a polygon with
polygon(poly,density=30,borders=gray(0.5))
I get gray borders but black shading lines; I have tried adding
col=gray(0.5), bg=gray(0.5) and fg=gray(0.5), but no luck.
How can I change the colors of the shading? The help file doesn't
seem to detail this, so any
2010 Oct 19
2
superpose.polygon, panel.polygon and their colors
Dear R-helpers,
the problem I'm facing today is to convince lattice to paint some areas
in gray.
The areas I would like to have in gray, are confidence bands
I've googled around in the mailing list archives and eventually find
some clues.
This link is my starting point
http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15595.html
I'm reproducing here the code for your convenience
est
2013 Sep 19
3
How do I ensure that the polygon in spatstat::owin(poly=<polygon>) does not have “negative area”
I am a new user of the R spatstat package and am having problems creating a
polygonal observation window with owin(). Code follows:
library("maps")
library ("sp")`
library("spatstat")
mass.map <- map("state", "massachusetts:main", fill=T) # This returns
a data frame includding x and y components that form a polygon of
massachusetts mainland`
2005 Apr 28
6
shading in line plots
Hello,
I cannot figure out how to shade between two lines in a plot. For
example, if I am trying to plot a confidence envelope and I would like to
shade the interior of the envelope grey. Is this possible in R?
Thanks in advance.
Heather Lynch
2007 Sep 26
1
Area of overlap between polygon and circle
R-listers,
Given a polygon and a circle defined by its center coordinates and a
radius, I would like to calculate the area of overlap. I know that I
can create a polygon from the circle and then use available packages to
get the area of the intersection. However, because the polygon is of a
fixed size and I will be doing this for circles of varying sizes, I'm
concerned about
2012 Feb 06
1
ggplot2 geom_polygon fill
Hi everyone,
i've been trying to make a special plot with ggplot2, but I can't get it to
fill the polygon I'd like to see filled so very very much.
I want to display the difference or change in the distribution of the
modified Rankin Scale between two groups. mRS is a scale for disability or
daily activities competence.
It looks like this.
2004 Dec 10
1
Adding a polygon to a time series plot
Preamble: Sorry for being dense.
Now that that's done, here are my questions.
I want to put a polygon on a plot of a time series. I'm going to add lines
from a smooth.spline interpolation and other annotation to it. But here's
the general idea:
# Start code
n <- 121
dat <- rnorm(n)
plot(dat, type="n")
polygon(c(1:n,n:1), c(dat,c(rep(0,n))), col =
2010 Aug 15
2
Adding colored background area to a time series plot
Hi,
I am trying to add a rectangular colored background area to a plot of a time series of relative price changes. I believe that what I'm trying to do is very similar to the question and example given here:
http://www.mail-archive.com/r-help at stat.math.ethz.ch/msg73948.html
http://www.mayin.org/ajayshah/KB/R/html/g5.html
My problem/difference is that my time series looks like so:
>
2006 Oct 23
1
calculate area of outer polygon
Dear all,
Does anyone know of a function that calculates the area of the outer
polygon constructed from a data frame with co-ordinates? For example,
library(splancs)
test = rbind(c(0,0), c(10,0),c(10,10),c(0,20))
plot(test)
areapl(test)
[1] 150
This is OK, but I want the same area to be returned (150) when adding
yet another co-ordinate in the middle of the polygon:
test = rbind(c(0,0),
2010 Jun 14
0
areaplot
I would like to propose adding a new plot function to the 'graphics'
package. The new function is called areaplot() and I have implemented it
as a generic function that supports a variety of data classes.
An area plot consists of a simple line, like plot(x, y, type="l"), except
the area between 0 and the line is a filled polygon. Areas can be stacked
on top of each other,
2004 Dec 19
1
Can I calculate the area of a polygon?
Hello,
I'm verry new in R.
My Problem:
I have a PostgreSQL-Server with installed support for the R-Language.
And now I have a table with a Polygon like this:
test_db=# select * from geo where id=1;
id | koerper
----+---------------------------------
1 | ((0,0),(0,2),(2,2),(3,3),(5,0))
(1 row)
Now, I need to know the area of this object. Please, can you tell me, if
it