I have two dataframes that I want to fit in an annotated heat map, and I want the user to be able to toggle between the two heat maps with buttons.
Problem is I canβt get update_layout to work as I expect it to. Here is my script:
a = np.random.rand(5, 5)
b = np.random.rand(5, 5)
fig = ff.create_annotated_heatmap()
a = [dict(a,
annotation_text=a,
)]
b = [dict(b,
annotation_text=b,
)]
fig.update_layout(
updatemenus=[
dict(
type="buttons",
buttons=list([
dict(label="choose a",
method="update",
args=[{"visible": [True, False]},
{"title": "a is best",
}]),
dict(label="choose b",
method="update",
args=[{"visible": [False, True]},
{"title": "b is better",
}]),
]),
)
])
fig.show()
This returns:
TypeError: create_annotated_heatmap() missing 1 required positional argument: 'z'
What am I missing?