title: 2D plot of a matrix with colors like in a spectrogram
body: <p>How to plot, with Python, a 2D matrix <code>A[i,j]</code> like this:</p>
  
  <ul>
  <li><code>i</code> is the x-axis</li>
  <li><code>j</code> is the y-axis</li>
  <li><code>A[i,j]</code> is a value between 0 and 100 that has to be drawn by a colour (ex: 0=blue, 100=red)</li>
  </ul>
  
  <p><strong>Is there a Python function for that?</strong> </p>
  
  <p>(NB: I don't want a function that does the spectrogram for me, such as <a href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.specgram.html" rel="nofollow noreferrer"><code>specgram</code></a>, because I want to compute the FFT of the signal myself; thus I only need a function that plots a matrix with colors)</p>
  
  <p><img src="https://i.stack.imgur.com/B8byi.jpg" alt="Spectrogram sample"></p>