I was wondering if there was a way to change the background color of a graph depending on the variables on the x-axis. (e.g. 12 am - 10 am = blue, 10:01 am - 6 pm = green, etc)
The best way is to use shapes: https://plot.ly/python/shapes/
If youβre using Pandas, cufflinks
has some shortcuts for exactly this (also using shapes
):