def cubehelix_palette(n_colors=6, start=0, rot=0.4, gamma=1.0, hue=0.8, light=0.85, dark=0.15, reverse=False, as_cmap=False):
 cdict = mpl._cm.cubehelix(gamma, start, rot, hue)
 cmap = mpl.colors.LinearSegmentedColormap('cubehelix', cdict)
 x = np.linspace(light, dark, n_colors)
 pal = cmap(x)[:, :3].tolist()
 if reverse:
  pal = pal[::(-1)]
 if as_cmap:
  x_256 = np.linspace(light, dark, 256)
  if reverse:
   x_256 = x_256[::(-1)]
  pal_256 = cmap(x_256)
  cmap = mpl.colors.ListedColormap(pal_256)
  return cmap
 else:
  return _ColorPalette(pal)

def cubehelix_palette ( n_colors = 6 , start = 0 , rot = 0.4 , gamma = 1.0 , hue = 0.8 , light = 0.85 , dark = 0.15 , reverse = False , as_cmap = False ) : cdict = mpl . _cm . cubehelix ( gamma , start , rot , hue ) cmap = mpl . colors . LinearSegmentedColormap ( 'cubehelix' , cdict ) x = np . linspace ( light , dark , n_colors ) pal = cmap ( x ) [ : , : 3 ] . tolist ( ) if reverse : pal = pal [ : : ( - 1 ) ] if as_cmap : x_256 = np . linspace ( light , dark , 256 ) if reverse : x_256 = x_256 [ : : ( - 1 ) ] pal_256 = cmap ( x_256 ) cmap = mpl . colors . ListedColormap ( pal_256 ) return cmap else : return _ColorPalette ( pal )
make a sequential palette from the cubehelix system .