Changing default selected modeBar Button

I am using the plotly python library to generate offline graphs. But the default selected modebar button is the zoom button. I am trying to change it to “pan”. I tried adding a config based on
github plotly buttons by editing the ‘modeBarButtons’ and ‘modeBarButtonsToAdd’ fields. Changing things here allows me to hide/show buttons, but not the default selected button.

i.e. changing it from the red to blue marked buttons in the image.

Any help would be appreciated

You’re looking for:

1 Like

Thanks @etienne. This helped me. Maybe the documentation regarding the default dragmode could be elaborated. Its not clear from the documentation that this attribute also decides the default action of the modebar.

three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online