autofmt_xdate()不能将标签显示为对角线。
创始人
2024-11-12 14:00:26
0

可以使用set_rotate_mode()方法来设置标签的旋转模式,从而实现对角线显示。例如:

import matplotlib.pyplot as plt
import matplotlib.dates as mdates

fig, ax = plt.subplots()

# 添加日期数据
dates = ['2021-01-01', '2021-01-02', '2021-01-03', '2021-01-04', '2021-01-05', '2021-01-06']
y = [1, 2, 3, 4, 5, 6]
ax.plot(dates, y)

# 设置日期格式
date_format = mdates.DateFormatter('%Y%m%d')
ax.xaxis.set_major_formatter(date_format)

# 设置日期间隔
ax.xaxis.set_major_locator(mdates.DayLocator())

# 设置标签对角线显示
fig.autofmt_xdate()
ax.xaxis.set_rotate_mode('default')

plt.show()

相关内容

热门资讯

aapoker透明挂!wepo... aapoker透明挂!wepoke有辅助挂,(WEPOke)果然是有挂,解密教程(有挂细节)1、完成...
透视挂透视!wpk辅助器下载,... 透视挂透视!wpk辅助器下载,德普之星透视辅助软件是真的吗,今日头条(有挂教程);1、进入到黑科技之...
德州ai机器人!aapoker... 德州ai机器人!aapoker辅助工具,(wepOkE)总是存在有挂,必备教程(有挂解说);1、aa...
透视辅助!德普之星透视辅助软件... 透视辅助!德普之星透视辅助软件,aapoker辅助工具免费下载,必看攻略(有挂攻略);1、玩家可以在...
wepoke辅助!WPK透视辅... wepoke辅助!WPK透视辅助,(wePOKE)总是真的有挂,攻略教程(有挂教程)1、让任何用户在...
透视透视!wpk透视脚本,we... 透视透视!wpk透视脚本,wepoker作弊辅助,盘点一款(有挂详情)在进入辅助挂后,参与本局比赛的...
wepoke计算辅助!微扑克有... wepoke计算辅助!微扑克有辅助挂,(wepOKE)竟然是有挂,透视教程(有挂辅助)1、不需要AI...
透视智能ai!aapoker透... 透视智能ai!aapoker透视脚本安装包,wepoker免费透视脚本,玩家必看科普(有挂介绍)1、...
aapoker猫腻!aapok... aapoker猫腻!aapoker辅助工具,(wepokE)确实有挂,技巧教程(有挂教程)1、aap...
透视教程!红龙poker辅助,... 透视教程!红龙poker辅助,hhpoker辅助软件下载,一分钟了解(有挂教学)1、ai机器人多个强...