title: Invalid Dimensions Error MatplotLib
body: <p>I'm new to image work in <code>Python</code> and am struggling to get an image to show using <code>matplotlib</code>.</p>
  
  <p>The problem: </p>
  
  <p>I have a numpy array, of shape <code>(3072, )</code>. I recognize that this array represents an image that should have 3 channels (RGB) and images of 32x32 pixels. As such, I reshaped the image into <code>(3, 32, 32)</code> shape. </p>
  
  <pre><code>crab.shape
  &gt; (3072, )
  
  crab.reshape((3, 32, 32))
  crab.shape
  &gt; (3, 32, 32)
  
  matplotlib.pyplot.imshow(crab)
  &gt; TypeError: Invalid dimensions for image data
  </code></pre>
  
  <p>When I try to plot this using matplotlib, I get the following error: <code>Invalid dimensions for image data</code></p>
  
  <p>Am I incorrectly sizing this image? Any help would be much appreciated. Thanks</p>