首页 > 解决方案 > Seaborn 图在一个月的开始和结束时显示两个标签

问题描述

我使用x 轴是日期创建matplotlib了一个绘图。seabornx 轴电流看起来像我需要标签在中间并且只显示一次的地方。

这是我用来获取情节的代码:

fig, ax = plt.subplots(figsize=(16, 8.27))
plot = sns.lineplot(y="Y-Axis", x="date", data=data)
date_form = DateFormatter("%B")
ax.xaxis.set_major_formatter(date_form)
plt.show()

标签: pythonmatplotlibseaborn

解决方案


推荐阅读