If I use the template simple_white
as in fig.update_layout(template='simple_white')
and then draw on the plot with the pen tool the circle is filled with a grey color which I do not want.
import plotly.graph_objects as go
animals=['giraffes', 'orangutans', 'monkeys']
fig = go.Figure(data=[
go.Bar(name='SF Zoo', x=animals, y=[20, 14, 23]),
go.Bar(name='LA Zoo', x=animals, y=[12, 18, 29]),
])
fig.add_annotation(text="Absolutely-positioned annotation",
xref="paper", yref="paper",
x=0.8, y=0.7, showarrow=False)
fig.add_trace(go.Scatter(x=['giraffes', 'giraffes', 'orangutans', 'orangutans'], y=[20, 25, 25, 14],
fill=None, mode="lines", line=dict(color='rgba(0,0,0,1)',width=2),
)
)
fig.add_trace(go.Scatter(x=['giraffes', 'giraffes', 'orangutans', 'orangutans'], y=[32, 35, 35, 32],
fill=None, mode="lines", line=dict(color='rgba(0,0,0,1)',width=2)
)
)
fig.update_layout(template='simple_white', title='', yaxis_title='Title Y', barmode='stack',
dragmode='drawrect', font_size=12,
# style of new shapes
newshape=dict(line_color='magenta', fillcolor=None, opacity=0.5),
hoverlabel_namelength=-1)
# Make figure zoomable, hide logo et cetera
config = dict({'scrollZoom':True, 'displaylogo': True,
'modeBarButtonsToAdd':['drawopenpath', 'eraseshape']
})
# Change the bar mode
fig.update_layout(barmode='stack')
fig.show(config=config)
However, if I use If I use the template plotly_white
as in fig.update_layout(template='plotly_white')
and then draw on the plot with the pen tool the circle is not filled with a grey color which is what I want.
import plotly.graph_objects as go
animals=['giraffes', 'orangutans', 'monkeys']
fig = go.Figure(data=[
go.Bar(name='SF Zoo', x=animals, y=[20, 14, 23]),
go.Bar(name='LA Zoo', x=animals, y=[12, 18, 29]),
])
fig.add_annotation(text="Absolutely-positioned annotation",
xref="paper", yref="paper",
x=0.8, y=0.7, showarrow=False)
fig.add_trace(go.Scatter(x=['giraffes', 'giraffes', 'orangutans', 'orangutans'], y=[20, 25, 25, 14],
fill=None, mode="lines", line=dict(color='rgba(0,0,0,1)',width=2),
)
)
fig.add_trace(go.Scatter(x=['giraffes', 'giraffes', 'orangutans', 'orangutans'], y=[32, 35, 35, 32],
fill=None, mode="lines", line=dict(color='rgba(0,0,0,1)',width=2)
)
)
fig.update_layout(template='plotly_white', title='', yaxis_title='Title Y', barmode='stack',
dragmode='drawrect', font_size=12,
# style of new shapes
newshape=dict(line_color='magenta', fillcolor=None, opacity=0.5),
hoverlabel_namelength=-1)
# Make figure zoomable, hide logo et cetera
config = dict({'scrollZoom':True, 'displaylogo': True,
'modeBarButtonsToAdd':['drawopenpath', 'eraseshape']
})
# Change the bar mode
fig.update_layout(barmode='stack')
fig.show(config=config)
Why is this so? And how can I make the background white and also use the pen tool without fill color?