0

I've created a time series plot in R using the ggplot package, but I wanted to see if I could further customize it by creating target zones. I originally started with an Excel plot that allows me to move a gray box to different areas of the plot as an easier way to point out a range of temperatures. However, I wanted to see if I could replicate this in R. Here's a screenshot of my Excel plot to better explain my goal: Time Series on Excel. On the time series plot, you can see a gray box that you can drag around and change the size of to better define a range of temperatures (in this case, it covers from 15-25C). Is this possible to do on top of my time series plot in R? I'm only starting to code in R so it's been quite hard for me to navigate, and I appreciate any help I could get. Thanks!

sav
  • 1
  • 1
    Anything is possible, but you aren't very likely to receive a useful answer if you don't provide a reproducible example. Please see https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. – Axeman Nov 30 '20 at 03:19
  • Interactivity is sort of a separate thing in R, and there probably isn't an off-the-shelf solution for this particular thing. You *might* want to get some practice with static plots before you go interactive. However, the best way to learn is to tackle a project you're interested in, so if you really want to go for it then [the introduction to Shiny tutorial](https://shiny.rstudio.com/tutorial/) is a good place to start. – Gregor Thomas Nov 30 '20 at 03:31
  • Or, you might have luck with `plotly` - see these interactive examples from the [r graph gallery](https://www.r-graph-gallery.com/interactive-charts.html). If it works for you, this will be an easier method than Shiny. – Gregor Thomas Nov 30 '20 at 03:45

0 Answers0