1.极坐标公式
2.代码实现
%matplotlib inline
import math
import matplotlib.pyplot as plt
theta = [math.radians(d) for d in range(360)] # 把角度转化为弧度
rho = [1. - math.sin(t) for t in theta]
plt.subplot(1, 1, 1, projection='polar') # projection='polar' 表示极坐标下的图
plt.plot(theta, rho)
plt.gca().get_yaxis().set_ticks([0.5, 1, 1.5, 2])
plt.text(math.pi / 2, 1, r'$\rho = 1 - \sin \theta $', horizontalalignment='center')
plt.show()
3.显示结果