Hi everyone. I have a time-series dataset which I’ve plotted in Julia using
StatPlots.jl, and now would like to impose these grey bars on the plot to emphasize certain periods of time (such as wars/recessions etc.), I’ve attached an image below as an example, I’m using the same format (i.e. date on the x-axis, and some time-series measure on the y-axis). I’m trying to do so using the
bar command. I’d like these grey areas to show up in periods 24-28, and periods 85-86 for example. I’ve attached my pseudo-code here:
plt1 = bar((24:28), (85-86), fill=:lightgrey, label= "War")
However, this plots only the y-values as such. I’ve also tried a few variations on
bar_width (but not sure how to specify at which periods i.e. values on my x-axis I’d want them to be) and
x=(24:28) but this returns the error that the y-value should be equal to the x-value or greater only by 1.
Would appreciate all help, thank you.