我制作了一个 x 轴为datetime
(2012-8-1, 2012-10,7....)
我想放一个文本框来标记这个数字
id = ("(A)","(B)","(C)","(D)","(E)","(Average)")
X轴
months = mpl.dates.MonthLocator() # every month
days = mpl.dates.DayLocator(interval=5) # every 10 days
dateFmt=mpl.dates.DateFormatter('%m-%d')
ax.xaxis.set_major_formatter(dateFmt)
ax.xaxis.set_major_locator(months)
#ax.xaxis.set_minor_locator(days)
ax.xaxis_date()
Y轴
ax.set_ylim(ymin[i],ymax[i])
ax.set_ylabel(ylabels)
ax.axhline(linewidth=0.5,color="k")
ax.yaxis.set_major_locator(tk.MaxNLocator(nbins=3))
ax.yaxis.set_minor_locator(tk.MaxNLocator(nbins=6))
[tickline.set_markersize(3) for tickline in ax.yaxis.get_ticklines(minor=True)]
[tickline.set_markersize(2.5) for tickline in ax.yaxis.get_ticklines(minor=True)]
文本
ax.text(0.25,ymax[i],id[i],fontsize=15)
但我根本看不到标签。
我怎样才能意识到它?