title: Python - Plotting colored grid based on values
body: <p>I have been searching here and on the net. I found somehow close questions/answers to what I want, but still couldn't reach to what I'm looking for.</p>
  
  <p>I have an array of for example, 100 values. The values are in the range from 0 to 100.
  I want to plot this array as a grid, filling the squares according to the values in the array. </p>
  
  <p>The solutions I found so far are like the followings: </p>
  
  <p><a href="https://stackoverflow.com/questions/19586828/drawing-grid-pattern-in-matplotlib">Drawing grid pattern in matplotlib</a></p>
  
  <p>and</p>
  
  <p><a href="https://stackoverflow.com/questions/10194482/custom-matplotlib-plot-chess-board-like-table-with-colored-cells">custom matplotlib plot : chess board like table with colored cells</a></p>
  
  <p>In the examples I mentioned, the ranges of the colors vary and are not fixed.</p>
  
  <p>However, what I am wondering about, is whether I can set the ranges for specific values and colors.
  For example,
  if the values are between 10 and 20, let the color of the grid square be red.
  else if the values are between 20 and 30, let the color be blue. etc.</p>
  
  <p>How this could be achieved in python? </p>