fishball
fishball

Reputation: 111

Plotly map: inverse colorscale tick values

In Plotly maps (Python), how can I inverse the tick labels on the colorscale so that the smallest value is at the top and the largest at the bottom? For example, -100 at the top and 100 at the bottom?

Note: I do not want to change the colors, just the associated tick values.

Upvotes: 2

Views: 1302

Answers (1)

tfg250
tfg250

Reputation: 436

You can do it with the ticktext input

In your colorbar definition, include tickmode="array" along with ticktext= and tickvals= Something like this:

colorbar=dict(tickmode="array",ticktext=[100,-100],tickvals=[-100,100])

Upvotes: 1

Related Questions