在极坐标图中画了一个圆和两条直线
import numpy as np
from matplotlib import pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, polar = True)
theta1 = np.linspace(0, 2*np.pi, 100)
r1 = theta1*0 + 1 #到坐标原点的距离
ax.plot(theta1, r1, color='b')
theta2 = np.array([np.pi/2]*100) #构建100个Π/2
r2 = np.linspace(0, 1, 100)
ax.plot(theta2, r2, color='r')
theta3 = np.array([0]*100) #构建100个0
r3 = np.linspace(0, 1, 100)
ax.plot(theta3, r3, color='y')
plt.show()
如图所示
PS:因为想画出由原点发射的某角度的直线,极坐标里表示位置是用角度和离原点的距离表示value(azimuth,didtance)