Python-Matplotlib 25 极坐标

Python-Matplotlib 25 极坐标

 

 

EG1:

import numpy as np
import matplotlib.pyplot as plt

r = np.arange(1,6,1)

print(r)
theta = [0 ,  np.pi/2 , np.pi , 3*np.pi/2  , 2 * np.pi , ] # len(theta) == len(r)
print(theta)

ax = plt.subplot(111, projection='polar')
ax.plot(theta, r, color='r', linewidth=4)

ax.grid(True)
plt.show()

  

 

EG2:

posted @ 2017-02-23 19:55  ZSR0401  阅读(1666)  评论(0编辑  收藏  举报