Plotly map: inverse colorscale tick values

烈酒焚心 提交于 2019-12-24 14:34:33

问题


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.


回答1:


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])



来源:https://stackoverflow.com/questions/36231323/plotly-map-inverse-colorscale-tick-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!