code: def print_colors(palette, outfile="Palette.png"):
      
      fig = plt.figure()
      ax = fig.add_subplot(111)
  
      xmax = 20 * (len(palette) + 1)
      x1s = np.arange(0, xmax, 20)
      xintervals = [10] * len(palette)
      xx = zip(x1s, xintervals)
      ax.broken_barh(xx, (5, 10), facecolors=palette)
  
      ax.set_ylim(0, 20)
      ax.set_xlim(0, xmax)
      ax.set_axis_off()
  
      savefig(outfile)
docs: print color palette (a tuple) to a PNG file for quick check