Re: [R] Polygon shade

2015-10-07 Thread Jim Lemon
Hi bgnum,
You can try something like this:

testdates<-as.Date(paste(1:30,"Sep",2015),"%d %b %Y")
nemails<-sample(10:30,30,TRUE)
library(plotrix)
stackpoly(testdates,nemails,col="blue")

Jim


On Wed, Oct 7, 2015 at 12:20 AM, bgnumis bgnum  wrote:

> Hi All,
>
> I want to shade the area below "f" variable and it doesn´t draw:
>
> plot(z$Dateh[nn:length(z$Dateh)],f,type="l",col="black", xlab="Time",
> ylab="Line")
> grid()
> polygon(c(1, 1:st, st),c(0, f, 0), col = "blue")
>
> st is the length of f.
>
> But if I plot
>
> plot(f,type="l",col="black", xlab="Time", ylab="Correlation")
> grid()
> polygon(c(1, 1:st, st),c(0, f, 0), col = "blue")
>
> But the axis doesn´t refect the date labels.
>
> ¿What should I do in the first code to achive it draws the blue?
>
> ¿If not? How can I ommit the axis in the scond code and to add the
> z$Dateh[nn:length(z$Dateh)?
>
> Hope someone can help me.
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Polygon shade

2015-10-06 Thread bgnumis bgnum
Hi All,

I want to shade the area below "f" variable and it doesn´t draw:

plot(z$Dateh[nn:length(z$Dateh)],f,type="l",col="black", xlab="Time",
ylab="Line")
grid()
polygon(c(1, 1:st, st),c(0, f, 0), col = "blue")

st is the length of f.

But if I plot

plot(f,type="l",col="black", xlab="Time", ylab="Correlation")
grid()
polygon(c(1, 1:st, st),c(0, f, 0), col = "blue")

But the axis doesn´t refect the date labels.

¿What should I do in the first code to achive it draws the blue?

¿If not? How can I ommit the axis in the scond code and to add the
z$Dateh[nn:length(z$Dateh)?

Hope someone can help me.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.