Sergio René
unread,Mar 12, 2012, 4:11:50 PM3/12/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
Dear all:
I am having troubles for drawing a rectangle and then filling it with
a transparent colour. The problem is that the graphic generated has
the rectangle but the colour is solid. I am not sure what I am doing
wrong, below my code
Value<-rnorm(1000)
t<-(1:200)
Time<-c(t,t,t,t,t)
Model<-c(rep("A",200),rep("B",200), rep("C",200), rep("D",200),
rep("E",200))
Figure<-data.frame(Value, Time, Model)
### call the libraries
library("ggplot2")
library(reshape)
Plot<-qplot(x=Time, y=Value ,data=Figure, geom="line", colour="Model")
+
facet_wrap(~Model, ncol=2, scales="free")+
ylab("Error Term")+
scale_color_manual(values=c("blue"))+
scale_size_manual(values=c(10))+
geom_rect(aes(NULL, NULL,color=NULL, ymin=-1, ymax=1,fill=NA),
xmin=0, xmax=200,)+
scale_fill_manual(values = alpha(c("red"), 0.2))+
opts(axis.text.x=theme_text(size=16, colour="black"))+
opts(axis.text.y=theme_text(size=16, colour="black"))+
opts(axis.title.y=theme_text(size=16, colour="black", angle=90))+
opts(axis.title.x=theme_text(size=16, colour="black"))+
opts(strip.text.x=theme_text(size=16))+
opts(strip.text.y=theme_text(size=16,angle=270))+
opts(panel.grid.minor=theme_blank())+
opts(panel.grid.major=theme_blank())+
opts(panel.background=theme_rect(size=1))+
opts(strip.background=theme_rect(fill=NA, colour=NA))+
opts(legend.position="none")
Plot
Does anyone has an idea what I am doing wrong?
best,
Sergio René