title: R: How to change plot background color for a specific range in ggvis shiny app
body: I have a simple shiny app like below and you can run it. The plots are created by <code>ggvis</code> and user can choose student name from <code>inputSelect</code>. In the plots, I want to change the color of background in specific score range. For example, <strong>in each plot</strong>, the color of plot background for the score higher than 80 or lower than 50 are highlighted with blue(See picture attached). I was trying to add layers and draw rectangles onto plot using <code>layer_rects()</code>, but the problem is the values of x-axis are changed if different students are chosen.Anyone did this before or any ideas? And is it possible if I want only the points in that score range pop up? Thanks a lot!
  <p><a href="https://i.stack.imgur.com/4WHS5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4WHS5.png" alt="example pic" /></a></p>
  <pre><code>  library(shiny)
      library(ggvis)
  
  df &lt;- data.frame(Student = c(&quot;a&quot;,&quot;a&quot;,&quot;a&quot;,&quot;a&quot;,&quot;a&quot;,&quot;b&quot;,&quot;b&quot;,&quot;b&quot;,&quot;b&quot;,&quot;b&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;),
                   year = c(seq(2001,2005,1),seq(2010,2014,1),seq(2012,2015,1)),
                   score = runif(14,min = 50,max = 100), stringsAsFactors=F)
  
  ui = (fluidPage(
    sidebarLayout(
      sidebarPanel(
        selectInput(&quot;stu&quot;,&quot;Choose Student&quot;,
                    choice = unique(df$Student))
      ),
      mainPanel(ggvisOutput(&quot;plot&quot;))
      )
    )
  )
  
  server = function(input,output,session){   
    
    dataInput = reactive({
      gg = df[which(df$Student == input$stu),]
    })
    
    vis = reactive({
      data = dataInput()
      data %&gt;%
        ggvis(x = ~year, y = ~score) %&gt;%
        scale_numeric(&quot;y&quot;,domain = c(40,120))%&gt;%
        layer_lines()
    })
    
    vis %&gt;% bind_shiny(&quot;plot&quot;)
  }
  
  runApp(list(ui = ui, server = server))
  </code></pre>