如何将 matplotlib X 轴时间戳格式设置为小时和分钟

matplotlib_timestamp_hm.py
import matplotlib.dates as mdates

plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))

Check out similar posts by category: Python