Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

matplotlib: use colormaps for line plot colors

import numpy as np
import matplotlib.pylab as plt
plt.rcParams["figure.figsize"] = [7, 7]
plt.rcParams["figure.autolayout"] = True
x = np.array([0,1])
y = np.array([1,1])
n = 50
colors = plt.cm.hsv(np.linspace(0, 1, n))
for i in range(n):
    plt.plot(x,y * i, color=colors[i])
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: super title python 
Python :: py one line function 
Python :: best algorithm for classification 
Python :: get column or row of matrix array numpy python 
Python :: python list index() 
Python :: python tuple get index of element 
Python :: pyqt setfocus 
Python :: python pyaudio error 
Python :: first and last name generator python 
Python :: beautifulsoup get h1 
Python :: python max value in list 
Python :: python how to raise an exception 
Python :: matplotlib pie chart order 
Python :: python fiboncci 
Python :: django background_task 
Python :: Python-dotenv could not parse statement starting at line 1 
Python :: python try catch print stack 
Python :: python for data analysis 
Python :: pass args and kwargs to funcitons 
Python :: sumof product 1 
Python :: python array find lambda 
Python :: Python Requests Library Delete Method 
Python :: pop element from heap python 
Python :: thousand separator python 
Python :: chatterbot python 
Python :: how to make a list in python 
Python :: remove columns that start with pandas 
Python :: python install graphviz and 
Python :: for char in string python 
Python :: python to exe online 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =