The layout.shape.layer = 'below'option works fine when using the plotly.plotly.plot() function. i.e. it puts the rectangle below any plotted traces.
However, when plotly.offline.plot() is used, irrespective of whether the value of that parameter is set to 'below' or 'above', the shape appears on TOP of the traces...
I'm just trying to shade a region behind some bar plots... i.e. the equivalent of axhspan in matplotlib.
layout = {
'barmode': 'stack',
'shapes': [
{
'type': 'rect',
'x0': 0,
'y0': 5,
'x1': 20,
'y1': 10,
'layer': 'below',
'fillcolor': 'rgba(128, 0, 128, 0.3)'
}]
}