title: How to filter heatmap colorscale in Plotly Dash?
body: <p>I am new to plotly dash. I am trying to create an interactive dashboard where I can filter the colorbar to see the upper values for example if the value is 3000 it was red, so if I type 3000 as input, it is still red but the graph will not show values less than 3000. I am able to add the filtering option but when I filter(I used zmin in go heatmap) the colorscale also changes. Can I keep the previous colorscale so that if I choose zmin, it refreshes the graph with the original colorscale but filters values greater than zmin? Here is the code I have written so far -</p>
  <pre><code>app.layout = html.Div(children=[
      html.H1(children='Title'),
  
      dcc.Graph(
          id='graph',
          figure=fig
      ),
      dcc.Input(
          id=&quot;input&quot;, type=&quot;number&quot;, value=0
      )
  ])
  @app.callback(
      Output('graph', 'figure'),
      Input('input', 'value')
  )
  def update_figure(input):
      frames = []
      for d, i in enumerate(sorted(timestamp_list)):
          frames.append(
              go.Frame(
                  name=time.strftime(&quot;%a, %d %b %Y %H:%M:%S&quot;, time.localtime(int(i) / 1000)),
                  data=[
                      go.Heatmap(z=df_dict[i],
                                 x=df_dict[i].columns,
                                 y=df_dict[i].index,
                                 zmin=input,
                                 zmax=max(value_list))
                  ]
              )
          )
      yaxis_name = kind.split(&quot;_&quot;)[0]
      xaxis_name = kind.split(&quot;_&quot;)[1]
  
  
      fig = go.Figure(
          data=frames[0].data,
          frames=frames,
          layout=go.Layout(
              autosize=True,
              height=800,
              yaxis={&quot;title&quot;: yaxis_name, &quot;dtick&quot;: 1},
              xaxis={&quot;title&quot;: xaxis_name, &quot;tickangle&quot;: 45, &quot;side&quot;: 'top'},
  
          ),
      )
  
      # finally, create the slider
      fig.update_layout(
          updatemenus=[{
                  'buttons': [
                      {
                          'args': [None, {'frame': {'duration': 500, 'redraw': True},
                                          'transition': {'duration': 500, 'easing': 'quadratic-in-out'}}],
                          'label': 'Play',
                          'method': 'animate'
                      },
                      {
                          'args': [[None], {'frame': {'duration': 0, 'redraw': False},
                                            'mode': 'immediate',
                                            'transition': {'duration': 0}}],
                          'label': 'Pause',
                          'method': 'animate'
                      }
                  ],
                  'direction': 'left',
                  'pad': {'r': 10, 't': 100},
                  'showactive': False,
                  'type': 'buttons',
                  'x': 0.1,
                  'xanchor': 'right',
                  'y': 0,
                  'yanchor': 'top'
              }],
          sliders=[{&quot;steps&quot;: [{&quot;args&quot;: [[f.name], {&quot;frame&quot;: {&quot;duration&quot;: 0, &quot;redraw&quot;: True},
                                                   &quot;mode&quot;: &quot;immediate&quot;, }, ],
                               &quot;label&quot;: f.name, &quot;method&quot;: &quot;animate&quot;, }
                              for f in frames],
                    }]
      )
      return fig
  </code></pre>
  <p>Here is the sample output I get-[![enter image description here][1]][1]
  After filtering- [![enter image description here][2]][2]</p>