我想從我的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()進行格式化,是否有一個特定的格式化程序可以用來控制秒的外觀? –