simple shaded rectangle overlay on plots

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

simple shaded rectangle overlay on plots

Simon Melov
I'm sure this is pretty straightforward, but I cant seem to figure it  
out after playing around with grid, and a number of other packages for  

I have data of the following type (much larger of course, and in this  
case is named "Medoid4"). The first column defines the x-axis, while  
as each other column is individual y-axes in different plots

gene1 gene2 gene3
4 -0.74 -0.63 -0.12
8 3.2 0.3 0.98
12 0.35 0.59 0.22
14 0.22 0.62 -0.2

and I'm graphing simple line plots using the following commands.

par(mfrow=c(5,2), mai=c(0.7,0.3,0.2,0.2), omi=c(0.5,0.5,0.5,0.5))
for(i in 2:ncol(Medoid4)){
   plot(Medoid4[,1], Medoid4[,i], type="b", col="red",
   xlab = names(Medoid4)[i],font=2, ylab = "")}

I want to draw a simple box over each of the plots, transparent and  
colored to highlight specific portions of each plot (the same portion  
in each plot which is defined from the days old in the first column).  
I dont mind manually tweaking it initially, my problem is getting a  
box on the plots in the first place, which I have had no luck doing.

Please help!


        [[alternative HTML version deleted]]

[hidden email] mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.