它看起来就像其他绘图一样matplotlib
,即如果你想绘制两条曲线,你可以调用plt.polar
多次。
这是一个例子:
import numpy as np
import matplotlib.pyplot as plt
blue_thetas = np.linspace(np.pi/3, 2*np.pi/3, 100)
red_thetas = np.linspace(4*np.pi/3, 6*np.pi/3, 100)
blue_rs = np.random.uniform(4, 6, len(blue_thetas))
red_rs = np.random.uniform(3, 5, len(red_thetas))
red_curve = plt.polar(red_thetas, red_rs, c='r', label="calculated")
blue_curve = plt.polar(blue_thetas, blue_rs, c='b', label="measured")
plt.legend(loc=10)
plt.xticks(np.concatenate((red_thetas[::20], blue_thetas[::30])))
plt.title("test polar image")
plt.show()
source: https://matplotlib.org/3.1.1/gallery/misc/transoffset.html#sphx-glr-gallery-misc-transoffset-py https://matplotlib.org/3.1.1/gallery/misc/transoffset.html#sphx-glr-gallery-misc-transoffset-py
另一篇可能对您有用的 stackoverflow 帖子是:浮动径向轴 https://stackoverflow.com/questions/24457488/polar-plot-with-a-floating-radial-axis?rq=1