title: Show OpenCV image in matplotlib's subplots
body: <p>I am having troubles in showing OpenCV images in matplotlib's subplot</p>
  
  <pre><code>#Read random images from multiple directories
  import random
  animals = os.listdir('signs/train')
  sample_images = []
  for a in animals:
    dirname = 'signs/train/' + a
    files = random.sample(os.listdir(dirname), 5)
    files = [dirname + '/' + im for im in files]
    sample_images.extend(files)
  
  del files, dirname,   animals
  print(sample_images)
  
  # Output: ['signs/train/rooster/00000327.jpg', 'signs/train/rooster/00000329.jpg', 'signs/train/rooster/00000168.jpg', ...,  'signs/train/rooster/00000235.jpg', 'signs/train/rooster/00000138.jpg']
  
  #Read using OpenCV and show in matplotlib's subplots
  
  fig, ax = plt.subplots(12, 5,figsize=(15,15), sharex=True)
  for idx, si in enumerate(sample_images):
    i = idx % 5 # Get subplot row
    j = idx // 5 # Get subplot column
    image = cv2.imread(si)
    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) 
    image = cv2.resize(image, (64, 64))
    ax[i, j].plot(image)
  plt.show()
  </code></pre>
  
  <p>I have checked that each image is successfully loaded and resized using opencv, but I don't know why I keep getting the following error when I plot them on <code>matplotlib</code>'s <code>subplot</code>.</p>
  
  <hr>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  
  &lt;ipython-input-56-38cc921c1724&gt; in &lt;module&gt;()
       10   #image = Image.open(si)
       11   #print(type(image))
  ---&gt; 12   ax[i, j].plot(image)
       13 plt.show()
  
  3 frames
  
  /usr/local/lib/python3.6/dist-packages/matplotlib/axes/_base.py in _xy_from_xy(self, x, y)
      271         if x.ndim &gt; 2 or y.ndim &gt; 2:
      272             raise ValueError("x and y can be no greater than 2-D, but have "
  --&gt; 273                              "shapes {} and {}".format(x.shape, y.shape))
      274 
      275         if x.ndim == 1:
  
  ValueError: x and y can be no greater than 2-D, but have shapes (64,) and (64, 64, 3)
  </code></pre>
  
  <p><strong>EDIT</strong>
  I forgot to mention that I have tried testing on one image, and it works (even if it is JPG format and still uses RGB channels)</p>
  
  <p><a href="https://i.stack.imgur.com/oSZcJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oSZcJ.png" alt="enter image description here"></a></p>
  
  <p>What am I doing wrong? </p>