极轴上绘制线段在极轴上绘制线图的演示。 12345678910111213141516import numpy as npimport matplotlib.pyplot as pltr = np.arange(0, 2, 0.01)theta = 2 * np.pi * rax = plt.subplot(111, projection='polar')ax.plot(theta, r)ax.set_rmax(2)ax.set_rticks([0.5, 1, 1.5, 2]) # Less radial ticksax.set_rlabel_position(-22.5) # Move radial labels away from plotted lineax.grid(True)ax.set_title("A line plot on a polar axis", va='bottom')plt.show() 参考本示例中显示了以下函数,方法,类和模块的使用: 1234567import matplotlibmatplotlib.axes.Axes.plotmatplotlib.projections.polarmatplotlib.projections.polar.PolarAxesmatplotlib.projections.polar.PolarAxes.set_rticksmatplotlib.projections.polar.PolarAxes.set_rmaxmatplotlib.projections.polar.PolarAxes.set_rlabel_position 下载这个示例 下载python源码: polar_demo.py 下载Jupyter notebook: polar_demo.ipynb