Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

draw spiral in matplotlib

import numpy as np 
import matplotlib.pyplot as plt 
import matplotlib.cm as cm 

n = 256
angle = np.linspace(0,12*2*np.pi, n)
radius = np.linspace(.5,1.,n)

x = radius * np.cos(angle)
y = radius * np.sin(angle)

plt.scatter(x,y,c = angle, cmap = cm.hsv)
plt.show()

// Matplotlib CB
Comment

PREVIOUS NEXT
Code Example
Python :: tkinter boilerplate 
Python :: disable devtools listening on ws://127.0.0.1 python 
Python :: run JupyterLab 
Python :: how to clear console in repl.it python 
Python :: python deep copy of a dictionary 
Python :: column standardization pandas 
Python :: python check ram usage 
Python :: install library from python code 
Python :: PRINT VS RETURN IN PYTHON 
Python :: python choose random sample from list 
Python :: Show the records that have nan values 
Python :: python cd to script directory 
Python :: get list input from user in python 
Python :: python name of current file 
Python :: python querystring parse 
Python :: pandas groupby as new column 
Python :: plt.clear 
Python :: python float to string n decimals 
Python :: django raise 404 
Python :: python get time milliseconds 
Python :: django import model from another app 
Python :: hello worldpython 
Python :: how to create a car game using python 
Python :: use beautifulsoup 
Python :: django migrate using db 
Python :: how to clear the console python 
Python :: load ui file pyqt5 
Python :: how to create a object in djago views model 
Python :: rotate labels matplotlib 
Python :: display text in pygame 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =