Hello,
Iām making figures using python 3.5, and having trouble with buttons.
In this case I am making a histogram with barmode = āoverlayā, with multiple traces.
I want to be able to switch each trace on or off using buttons.
Following the examples on the tutorial page, I was able to use the following format:
updatemenus = list([
dict(type=ābuttonsā,
buttons =list([
dict(
label = āAgeā,
method = āupdateā,
args = [{āvisibleā : [True,False,False]}]),
dict(
label = āCopperā,
method = āupdateā,
args = [{āvisibleā : [False,True,False]}]),
dict(
label = āGoldā,
method = āupdateā,
args = [{āvisibleā : [False,False,True]}]),
dict(
label = āAllā,
method = āupdateā,
args = [{āvisibleā : [True,True,True]}])
])
)
])
This toggles visibility for the traces, but there are many more traces I want to plot, and this gets impractical. I would like to be able to have a single button for each trace, so that each could be toggled between āvisible/hiddenā, rather than have to make a custom button with boolean [True, False, True,ā¦] for each possible permutation.
Is this possible?
Thanks for your help.
(Edit: To be clear, I want to be able to display a custom selection from a larger group of traces by toggling them on or off with a button. If I use the method above, I have to create a button for each possible combination of on\off states, which is impractical.)