How do I draw rectangle (bounding boxes) on a subplot using plotly
? I have a graph
fig = plotly.tools.make_subplots(rows=2, cols=1)
and I'd like to add a rectangle to the plot in row 2. For the first row I can do
fig['layout']['shapes'].append(
{
'type': 'rect',
'x0': 1,
'x1': 2,
'y0': 3,
'y1': 4,
'line': {'color': 'red'}
}
)
But I can't figure out how to make a rectangle on the 2nd row.
I made a WAG and figured out that you can set
'yref': 'y1'
When creating the shape. Would be nice if there was an example of this on the web page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With