title: Plotly: How to interactively set heatmap colorscale using buttons?
body: <p>I am using Plotly to make some heatmaps. I would like to have an interactive color bar in order to be able to shift and/or change the scale, the same way as for the x and y axes but for the color scale. As a MWE consider the first code in <a href="https://plotly.com/python/heatmaps/#basic-heatmap-with-plotlygraphobjects" rel="nofollow noreferrer">this link</a>:</p>
  <pre><code>import plotly.graph_objects as go
  
  fig = go.Figure(data=go.Heatmap(
                      z=[[1, 20, 30],
                        [20, 1, 60],
                        [30, 60, 1]]))
  fig.show()
  </code></pre>
  <p>The x,y default functionality I want to replicate in the color bar can be seen in <a href="https://www.youtube.com/watch?v=ZjYP_wvqf04&amp;feature=youtu.be" rel="nofollow noreferrer">this video</a>. Basically I want to partially replicate the functionality of <a href="https://sites.google.com/cfa.harvard.edu/saoimageds9" rel="nofollow noreferrer">SAOImageDS9</a>. This functionality can be seen in <a href="https://youtu.be/G77RcsAfMGM?t=296" rel="nofollow noreferrer">this video</a>, if you right click and move the mouse you can change the color scale.</p>