0

I have the following line plot and want to fill the background using a color gradient relative to the monthly values of each year.

set.seed=500
dat <- data.frame("year"= c(2000:2005),"value" = c(1000,800,200,600,1000,900),"Jan"=runif(6,-3,3),"Feb"=runif(6,-3,3),"Mar"=runif(6,-3,3),"Apr"=runif(6,-3,3),"May"=runif(6,-3,3),"Jun"=runif(6,-3,3),"Jul"=runif(6,-3,3),"Aug"=runif(6,-3,3),"Sep"=runif(6,-3,3),"Oct"=runif(6,-3,3),"Nov"=runif(6,-3,3),"Dec"=runif(6,-3,3))
plot(x=dat$year, y=dat$value, type="b")
Geo-sp
  • 1,704
  • 3
  • 19
  • 42
  • Did you try an approach that failed? Do you have an example of what you are hoping the final plot will look like? I've seen what seem like similar questions, e.g., [here](http://stackoverflow.com/questions/9968975/using-ggplot2-in-r-how-do-i-make-the-background-of-a-graph-different-colours-in) and [here](http://stackoverflow.com/questions/30136725/ggplot2-plot-background-colour-gradient) but can't tell how related they are without more info. – aosmith Sep 07 '16 at 14:46
  • Thanks, those are very similar to what I'm looking for, but here for each year I want to show the trend in those monthly values. The color palette would be based on the monthly values not the months. – Geo-sp Sep 07 '16 at 15:26

0 Answers0