Skip to content
Advertisement

Plotly colorscale reverse direction

How can I reverse the direction of a colorscale in plotly? I am trying to use the color scale Viridis for a marker plot

JavaScript

but I want it to be darker for higher values and lighter for lower values. Is there any way to do this without defining my own custom colorscale or changing my color parameter array?

Advertisement

Answer

Just add reversescale = True to your plot definition and the colorscale is reversed.

JavaScript

enter image description here

Advertisement