I am trying make a plot with the background colors different for each section of the y-axis. For example:
using Plots gr() plot(Plots.fakedata(50, 1), w=3, fill = (0, 0.2, :red))
generates the image:
I want to fill the background of the graph with different colors. Like the area from -2 to 0 might be in red and be labelled as “risky”, from 0 to 2 as green and labelled as “ok”, etc.
Something like this:
plot(Plots.fakedata(50, 2), w=3) hline!( [collect(-10:10)], color=[:red,:green], width=30, alpha=collect(0.1:0.1:0.2), legend=false)
which generates this:
I looked at the plots documentation and could not figure a way to do it. Does the fill keyword argument accept a list of fillrange, fillalpha and fillcolor? is there any other way to do it?