title: Heat maps in python - with colors
body: <p>I try to make a program for plotting a heat map based on the clicks from the participants. There are two bodies with increase and decrease emotions. </p>
  
  <p>I want to show the intensity of clicks on the left body with blue color (more intense blue = more number of clicks) and right body with red color. </p>
  
  <p>The problem is that I need to show it in one body and also with the background image over which I see the heat map.</p>
  
  <pre><code>x=blue[:,1]
  y=blue[:,2]
  ax = plt.gca()
  
  heatmap, xedges, yedges = np.histogram2d(x, y, bins=50)
  extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]]
  plt.imshow(heatmap.T, extent=extent, origin='lower')
  ax = plt.gca()
  ax.invert_yaxis()
  
  plt.show()
  
  x1=red[:,1]
  y1=red[:,2]
  ax = plt.gca()
  
  heatmap, xedges, yedges = np.histogram2d(x1, y1, bins=50)
  extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]]
  
  plt.clf()
  plt.imshow(heatmap.T, extent=extent, origin='lower')
  ax = plt.gca()
  ax.invert_yaxis()
  
  plt.show()
  plt.imshow(image)
  
  imageFile = cbook.get_sample_data('C:\\Users\\Admin\\Desktop\\pythonpca\\result.png')
  image = plt.imread(imageFile)
  plt.plot(all_samples[0:240,0],all_samples[0:240,1], 'o', markersize=3, color='blue', alpha=0.5, label='increase')
  plt.imshow(image)
  </code></pre>
  
  <p>By this I get a heat map for the left body clicks, a heat map for right body clicks and a picture of the left and right bodies. I want them all in the same picture, with blue and red hotspots. I am attaching the pictures I get with this.</p>
  
  <p>2 bodies picture (I have plotted blue points on it, but I do not need the points):</p>
  
  <p><img src="https://i.stack.imgur.com/JWUZB.png" alt="2 bodies picture ( I have plotted blue points on it, but I do not need the points"></p>
  
  <p>The heat maps from the left and right bodies:</p>
  
  <p><img src="https://i.stack.imgur.com/F1uj4.jpg" alt="the heat maps from the left and right bodies"></p>
  
  <p>Please let me know if I should add more info.</p>