Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

generate n different colors matplotlib

import matplotlib.pyplot as plt

def get_cmap(n, name='hsv'):
    '''Returns a function that maps each index in 0, 1, ..., n-1 to a distinct 
    RGB color; the keyword argument name must be a standard mpl colormap name.'''
    return plt.cm.get_cmap(name, n)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #generate #colors #matplotlib
ADD COMMENT
Topic
Name
6+1 =