title: Plotly Heatmap - Python - Add colorbar
body: <p>I have a heatmap that I have produced from a dataframe. Unfortunately it does not have a colorbar with it. I have tried adding one, but it doesnt show. Any ideas?</p>
  
  <p>This is the code:</p>
  
  <pre><code>zp = df_hml.values.tolist()
  zp.reverse()
  z = zp
  z_text = np.around(z) 
  
  x = [threeYr,twoYr,oneYr,Yr]
  y=['March', 'February', 'January', 'December', 'November', 'October', 'September', 'August', 'July', 'June', 'May', 'April']
  
  
  layout = go.Layout(
      autosize=False,
      width=700,
      height=450,
      margin=go.Margin(
          l=150,
          r=160,
          b=50,
          t=100,
          pad=3
      ),
  )
  colorscale = [[0, '#454D59'],[0.5, '#FFFFFF'], [1, '#F1C40F']]
  fig = ff.create_annotated_heatmap(z, x=x, y=y, annotation_text=z_text,colorscale=colorscale,  hoverinfo='z')
  
  # Make text size smaller
  for i in range(len(fig.layout.annotations)):
          fig.layout.annotations[i].font.size = 9
  
  fig.layout.title = '&lt;b&gt;Research - HEATMAP&lt;/b&gt;&lt;br&gt;Applications'
  fig.layout.titlefont.size = 14
  
  fig.layout.width = 700
  fig.layout.height = 550 
  plotly.offline.iplot(fig, config={"displayModeBar": False}, show_link=False, filename='annotated_heatmap_numpy')
  </code></pre>
  
  <p>Which produces this:</p>
  
  <p><a href="https://i.stack.imgur.com/tIBdt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tIBdt.png" alt="enter image description here"></a></p>