Black Lives Matter. Please consider donating to Black Girls Code today.

How to customize the tools palette zoom, pan, reset, etc?

I create a plot using plotly_express. I would like to have the selection tool enabled by default and remove other tools such as zoom. Is this possible? I don’t find any documentation about it.

Hi @Soerendip, once you have created your figure object with plotly.express, you can use the config parameter in fig.show as described in


You can find the names of buttons in https://github.com/plotly/plotly.js/blob/master/src/components/modebar/buttons.js

I am using the plot in a Dash app. So, I am not calling fig.show().

you can pass config to a dcc.Graph then.

I am using ´plotly_express´

px.bar(...)

Great! You can use @Emmanuelle’s advice like so: dcc.Graph(figure=px.bar(...), config={...})