Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: python dictionary pop key 
Python :: calculate mean of column pandas 
Python :: zip a directory in python 
Python :: how to append in dictionary in python 
Python :: upload file to aws 
Python :: move column in pandas dataframe 
Python :: username python system 
Python :: get value from index python 
Python :: pandas como quitar comillas simples de una columna 
Python :: python np get indices where value 
Python :: download unsplash images 
Python :: how to add a linebreak in python 
Python :: how to decrease size of graph in plt.scatter 
Python :: python obfuscator github 
Python :: percent in pandas 
Python :: python staticmethod property 
Python :: a int and float. python 
Python :: python 3 slice reverse 
Python :: python variable scope 
Python :: create array of specific size python 
Python :: boto3.client python 
Python :: how to hide tkinter window 
Python :: python factor number 
Python :: wap in python to check a number is odd or even 
Python :: trim string to max length python 
Python :: confusion matrix with seaborn heatmap 
Python :: python sort descending 
Python :: python gaussian filter 
Python :: python not equal to symbol 
Python :: django render example 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =