我想从我的x轴标签中删除秒,因为它们是不必要的。删除matplotlib中x轴时间标签的秒数
此外,我想中心对齐刻度标签,而不是让它们位于刻度标记的左侧。
有关如何做到这一点的任何建议?
下面是一些我使用,如果这有助于
fig=plt.figure()
ax=fig.add_subplot(111)
line1 = plot(table.index,table[data],color=colors[0])
fig.autofmt_xdate(rotation=0)
tickFormat = matplotlib.ticker.LinearLocator(numticks=5)
ax.xaxis.set_major_locator(tickFormat)
你能告诉我们你是如何产生这个图形的某些代码的代码?你只需要调整格式化程序的参数。 (但我不想猜你使用的格式化程序) – tacaswell
我已经使用了fig.autofmt_xdate()进行格式化,是否有一个特定的格式化程序可以用来控制秒的外观? –