title: Python - Mapping a 2d array to a grid with pyplot?
body: <p>I'm new to pyplot and haven't been able to find a proper solution to map an array to a coloured grid. For example, if I have a 10x10 2d array and 10x10 grid:</p>
  
  <pre><code>[[0,0,0,0,0,1,1,1,1,0],
  [0,0,0,0,0,1,0,0,1,0],
  [0,0,1,0,1,0,1,1,0,0],
  [0,0,1,0,0,1,1,0,1,0],
  [0,0,1,0,1,0,0,1,1,0],
  [1,0,0,1,0,1,0,0,1,0],
  [0,1,0,0,0,1,1,1,1,1],
  [0,1,0,0,0,0,1,1,1,1],
  [1,0,0,0,1,1,1,0,1,0],
  [1,1,1,1,0,0,0,1,1,0]]
  </code></pre>
  
  <p>If 0s and 1s are blues and reds respectively then the grid should look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/2tSoC.png" alt="colored grid (I didn&#39;t generate this image)"></p>
  
  <p>How can I do this with pyplot?</p>