我想在极坐标图的左侧写上 ylabel,就像在非极坐标图中一样。这是我的代码:
import matplotlib.pyplot
axes=matplotlib.pyplot.figure().add_subplot(1,1,1,polar=True,frameon=False)
import numpy
x=numpy.linspace(0,12*numpy.pi,2000)
axes.plot(x,numpy.exp(numpy.cos(x))-2*numpy.cos(4*x)+numpy.sin(x/12)**5,color="black")
axes.set_xlabel("y")
axes.set_ylabel("$P_y$")
axes.set_xticklabels([])
axes.set_yticklabels([])
axes.grid(False)
import matplotlib.backends.backend_pdf
output=matplotlib.backends.backend_pdf.PdfPages("butterfly.pdf")
output.savefig()
output.close()
我得到这样的结果:
但是,我不喜欢图片中间的 P_y,我希望它回到左侧,就像这样:
我只是想把ylabel改到左边,其他关于这两张图片差异的细节可以忽略。我尝试使用:
axes.set_ylabel("$P_y$",position=(0,0.5),transform=axes.transAxes)
但不要帮助。
谢谢