Displaying 20 results from an estimated 10000 matches similar to: "polygon"
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
2007 Nov 26
1
visualizing nucleotide sequence properties
Hi there,
I am looking for R-packages that can help me visualize properties on
nucleotide sequences. I want to display sequences in the 1-100K base range
as lines and plot features above and below those lines.
Any ideas would be welcome.
Thanks,
Bernd
[[alternative HTML version deleted]]
2008 Feb 25
1
color area between two time-series via polygon()?
Hi all,
I would like to color the area between two time-series. I tried it by
using the polygon() function but I keeps drawing lines between beginning
and end points.
Is there another more appropriate function or how could I close the
polygon at the end en the beginning of the time series (e.g., drawing a
straight line)?
The following doesn't plot a polygon between the two
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)
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
2008 Aug 28
4
Help with shading a polygon below a segment of a curve (normal distribution)
Dear R users,
I still feel new to R so please apologize if I am doing something stupid
here. My use of the polygon() function produces a result that I cannot
comprehend: In a plot, I would like to shade the area below a normal
distribution. However, I do not want the entire area to be shaded, but
just the area on the right side of a vertical line that I draw through
the distribution (in
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.
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 Dec 02
1
polygon graph
Hi all,
I have a matrix dd with dates and data. i WANT to create a grpah with shade
between the line and the zero axis. I?m trying to use polygon but something
doesn? t work
Imagine.
I want to plot
g<-read.table("dd.txt", col.names=c("fecha","DP"))
g$fecha <- as.Date(g$fecha, format="%d/%m/%Y")
t<-g$fecha
st<-length(g$DP)
2010 Aug 04
1
help with using grid.polygon()
Hi,
I'm trying to use grid.polygon() to plot several polygons at once, with a
view to putting coloured polygons beneath a curve. I'm struggling just to
get the grid.polygon to plot anything
# PLOT SOME POINTS
x <- 1:100
y <- 1:100*0.5 + 3
plot(x, y, pch = ".")
# PLOT 2 POLYGONS
library(grid)
grid.polygon(x = c(20, 20, 40, 40, 40, 40, 60, 60),
y =
2011 Nov 18
1
How to fill irregular polygons with patterns?
Hi,
I'm looking the best way to fill irregular polygons with patterns,
Something like the function grid.pattern do, but my case is with
irregular polygons.
Whit this script I can get it, but I'm looking for an "elegant" solution..
library(grid)
grid.polygon(x=c(0.2, 0.8, 0.6, 0.6, 0.8, 0.2),
y=c(0.2, 0.2, 0.3, 0.5, 0.7,0.7),
gp=gpar(fill="grey",
2006 Oct 02
2
xyplot Graphic Help
I have the following graphic where I drop unused factors in the x axis, however I cannot get the first point on the second panel. It seems shifted. Any ideas?
The example is below:
data <- data.frame(
Room=as.factor(c(132,132,132,132,132,132,132,132,132,196,196)),
2012 Jul 10
2
how can I show the xlab and ylab information while using layout
hi R-users:
I want to draw three plot into one figure by layout and the script has
been shown below.
But I find R does not show the xlab and ylab information completely as
shown the figure attached.
How can I midify the script.? thank you .
xxlab<-paste(cpmd," (",ro,"%)",sep=" ")
yylab<-paste(rfmd," (",co,"%)",sep=" ")
2009 May 31
1
Bug in truncgof package?
Dear R-helpers,
I was testing the truncgof CRAN package, found something that looked
like a bug, and did my job: contacted the maintainer. But he did not
reply, so I am resending my query here.
I installed package truncgof and run the example for function ad.test. I
got the following output:
set.seed(123)
treshold <- 10
xc <- rlnorm(100, 2, 2) # complete sample
xt <- xc[xc >=
2007 Mar 07
5
How to open more windows to make more graphs at once!
Dear R users,
I have a data frame (test) including five columns of upper (numeric), lower (numeric), observed (numeric), best_sim (numeric) and stname (factor with 80 levels, each level with different length). Now I would like to write a short program to draw one graph as follow for each level of stname but I would like also to draw each time 12 graphs for the 12 levels of stname in the same
2004 Jun 04
1
rpart
Hello everyone,
I'm a newbie to R and to CART so I hope my questions don't seem too stupid.
1.)
My first question concerns the rpart() method. Which method does rpart use in
order to get the best split - entropy impurity, Bayes error (min. error) or Gini
index? Is there a way to make it use the entropy impurity?
The second and third question concern the output of the printcp() function.
2005 Aug 08
1
vector vs array
Hi!
OK, I'm trying to select some "useful outliers" from
my dataset: I defined 11 "treshold" values (1 for each
level of a variable (sampling site) as follows:
tresholds<-function(x)
{
tapply(x,mm$NAME,FUN=mean ,simplify = T, na.rm=T)->med
tapply(x,mm$NAME,FUN=sd ,simplify = T,
na.rm=T)->standev
standev+med
}
tresholds(mm$chl)
Now I'd like to select
2004 Feb 26
3
my own function given to lapply
Hi
It seems, I just miss something. I defined
treshold <- function(pred) {
if (pred < 0.5) pred <- 0 else pred <- 1
return(pred)
}
and want to use apply it on a vector
sapply(mylist[,,3],threshold)
but I get:
Error in match.fun(FUN) : Object "threshold" not found
thanks for help
cheers
chris
--
Christoph Lehmann <christoph.lehmann at gmx.ch>
2004 Jul 19
3
why won't rq draw lines?
I've been trying to draw quantile linear regression lines across a scatterplot of my data using
attach(forrq)
plot(PREGNANT,DAY8,xlab="pregnant EPDS",ylab="postnatal EPDS",cex=.5)
taus <- c(.05,.1,.25,.75,.9,.95)
xx <- seq(min(PREGNANT),max(PREGNANT),100)
for(tau in taus){
f <- coef(rq(DAY8~PREGNANT,tau=tau))
yy <-
2013 Mar 20
3
highlight overlapping region of two densities
Hi all.
I would like to highlight overlapping regions of two densities and I could
not find a way to do it.
Here is the sample code:
myd <- c(2,4,5, 4,3,2,2,3,3,3,2,3,3,4,2,4,3,3,3,2,2.5,
2, 3,3, 2.3, 3, 3, 2, 3)
myd1 <- myd-2
plot(range(density(myd)$x, density(myd1)$x), range(density(myd)$y,
density(myd1)$y), type = "n")
lines(density(myd), col=1, lwd=4)