Kenny Smith
Kenny Smith

Reputation: 889

Unmark all labels when show plotly figure

I have this code:

df = pd.DataFrame(np.random.rand(5, 6))
fig = px.bar(df)
fig.show()

which show this output: enter image description here

I would like the starting output unmark all the variables (or to add a button that unmark them), so this will be the starting output: enter image description here

Upvotes: 0

Views: 31

Answers (1)

Rob Raymond
Rob Raymond

Reputation: 31146

Straight forward use of update_traces()

df = pd.DataFrame(np.random.rand(5, 6))
fig = px.bar(df).update_traces(visible="legendonly")
fig.show()

Upvotes: 1

Related Questions