注释极坐标
此示例显示如何在极坐标图上创建注释。
有关注释功能的完整概述,另请参阅注释教程。
import numpy as npimport matplotlib.pyplot as pltfig = plt.figure()ax = fig.add_subplot(111, polar=True)r = np.arange(0,1,0.001)theta = 2 * 2*np.pi * rline, = ax.plot(theta, r, color='#ee8d18', lw=3)ind = 800thisr, thistheta = r[ind], theta[ind]ax.plot([thistheta], [thisr], 'o')ax.annotate('a polar annotation',xy=(thistheta, thisr), # theta, radiusxytext=(0.05, 0.05), # fraction, fractiontextcoords='figure fraction',arrowprops=dict(facecolor='black', shrink=0.05),horizontalalignment='left',verticalalignment='bottom',)plt.show()

参考
此示例中显示了以下函数,方法,类和模块的使用:
import matplotlibmatplotlib.projections.polarmatplotlib.axes.Axes.annotatematplotlib.pyplot.annotate
