我正在尝试注释一个次要情节。我想在剧情里放一封信,以便我在写标题的时候能帮上忙。
到目前为止,我正在尝试这种方式。无结果。有什么帮助吗?
fname='SHOT_'+str(shot)
plt.figure(fname)
ftitle='Time Traces - '+str(nshot[i])
plt.suptitle(ftitle, fontsize=11)
#PLOT 1
ax1 = plt.subplot(711)
# xy = get_axis_limits(ax1)
# print(xy)
plt.scatter(timetraces['Time_LID3'], savitzky_golay(np.array(timetraces['KG1V/LID3']), 17, 1),color='red', label="KG1V",s=10)
fxlabel='Time [s]'
fylabel='$part/m^{-2}$'
plt.locator_params(axis='y',nbins=4)
# plt.xlabel(fxlabel,{'color': 'k','size': 11})
plt.ylabel(fylabel,{'color': 'k','size': 8})
plt.setp(ax1.get_xticklabels(), visible=False)
plt.legend(prop={'size':8})
ax1.yaxis.set_minor_locator(AutoMinorLocator())
ax1.xaxis.set_minor_locator(AutoMinorLocator())
ax1.annotate('G', xy=get_axis_limits(ax1))
plt.subplots_adjust(wspace=0, hspace=0)
plt.show()发布于 2018-05-03 00:08:09
我不是百分之百确定你想要实现什么,但我怀疑如下所示:
import matplotlib.pyplot as plt
ax1 = plt.subplot(121)
plt.text(0.05, 0.95, "A", fontweight="bold", transform=ax1.transAxes)
ax2 = plt.subplot(122)
plt.text(0.05, 0.95, "B", fontweight="bold", transform=ax2.transAxes)
plt.show()结果:

https://stackoverflow.com/questions/50138866
复制相似问题