title: how can I specify a list of colors for rectangles using patches.PathPatch?
body: <p>I want to make a plot consisting of coloured rectangles, and have been using this example <a href="https://matplotlib.org/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py" rel="nofollow noreferrer">https://matplotlib.org/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py</a> as a guide:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.patches as patches
  import matplotlib.path as path
  
  fig, ax = plt.subplots()
  
  # Fixing random state for reproducibility
  np.random.seed(19680801)
  
  data = np.random.randn(1000)
  n, bins = np.histogram(data, 50)
  
  # get the corners of the rectangles for the histogram
  left = np.array(bins[:-1])
  right = np.array(bins[1:])
  bottom = np.zeros(len(left))
  top = bottom + n
  
  XY = np.array([[left, left, right, right], [bottom, top, top, bottom]]).T
  
  # get the Path object
  barpath = path.Path.make_compound_path_from_polys(XY)
  
  # make a patch out of it
  patch = patches.PathPatch(barpath)
  ax.add_patch(patch)
  
  # update the view limits
  ax.set_xlim(left[0], right[-1])
  ax.set_ylim(bottom.min(), top.max())
  
  plt.show()
  </code></pre>
  
  <p>I would like a different colour for each rectangle and thought I could do this using a list of floats in cols and setting </p>
  
  <pre><code>patch=patches.PathPatch(barpath,fill=True,color=cols
  ,cmap='CMRmap')
  </code></pre>
  
  <p>But I get "Invalid rgba arg", does this routine only recognize RGB lists?</p>