matplotlib极坐标

实践一:
import numpy as np
import matplotlib.pyplot as plt
r=np.arange(1,6,1)
theta=[0,np.pi/2,np.pi,3np.pi/2,2np.pi]
ax=plt.subplot(111,projection=‘polar’)
ax.plot(theta,r,color=‘r’,linewidth=3)
ax.grid(True)
plt.show()
matplotlib极坐标
实践二:
import numpy as np
import matplotlib.pyplot as plt
r=np.empty(5)
r.fill(5)
theta=[0,np.pi/2,np.pi,3np.pi/2,2np.pi]
ax=plt.subplot(111,projection=‘polar’)
ax.plot(theta,r,color=‘r’,linewidth=3)
ax.grid(True)
plt.show()
matplotlib极坐标
实践三:
import numpy as np
import matplotlib.pyplot as plt
r=np.empty(9)
r.fill(5)
pi_two=np.pi2
theta=[0,pi_two/8,2
pi_two/8,3pi_two/8,4pi_two/8,
5pi_two/8,6pi_two/8,7pi_two/8,8pi_two/8]
ax=plt.subplot(111,projection=‘polar’)
ax.plot(theta,r,color=‘r’,linewidth=3)
ax.grid(True)

plt.show()

matplotlib极坐标