title: Retrieving Matplotlib Heatmap Colors
body: <p>I am trying to retrieve the colors of each cell on a matplotlib heatmap, generated by the <code>imshow()</code> function, such as performed by the <code>magic_function</code> below:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  hm = plt.imshow(np.random.rand(10, 10))
  color_matrix = hm.magic_function() #returns matrix containing the RGB/Hex values of each cell
  </code></pre>