Can we restyle all subplots in a given figure?
Currenlty, only one (sub)plot is restyled.
Example
for scenario, trace in traces.items():
_heatmap = go.Heatmap(z=trace["z"], zmin=cmin, zmax=cmax, showscale=showscale)
showscale = False
fig_full.add_trace(_heatmap, row=trace["row"], col=trace["col"])
fig = go.Figure(data=[_heatmap])
fig.update_yaxes(autorange="reversed")
fig.write_html(F"heatmap_{scenario}.html")
fig_full.update_yaxes(autorange="reversed")
fig_full.update_layout(
yaxis=dict(scaleanchor="x", scaleratio=1),
yaxis2=dict(scaleanchor="x2", scaleratio=1),
yaxis3=dict(scaleanchor="x3", scaleratio=1),
yaxis4=dict(scaleanchor="x4", scaleratio=1),
)
# Add dropdown
fig_full.update_layout(
updatemenus=[
dict(
type="buttons",
direction="left",
buttons=list([
dict(
args=["type", "surface"],
label="3D Surface",
method="restyle"
),
dict(
args=["type", "heatmap"],
label="Heatmap",
method="restyle"
)
]),
pad={"r": 10, "t": 10},
showactive=True,
x=0.11,
xanchor="left",
y=1.1,
yanchor="top"
),
]
)
fig_full.write_html(F"heatmap_all.html")