matplotlib绘制X轴密度
作者:互联网
_xticks = ['2017年{}月'.format(i) for i in range(2, 13)]
_xticks += ['2018年{}月'.format(i) for i in range(1, 13)]
_xticks += ['2019年{}月'.format(i) for i in range(1, 13)]
_xticks += ['2020年{}月'.format(i) for i in range(1, 13)]
plt.xticks(df_retail2017_2020.日期[::2], _xticks[::2], rotation=45, ha='right', fontsize=8)
标签:13,plt,format,matplotlib,xticks,range,2020,密度,绘制 来源: https://blog.csdn.net/weixin_50980171/article/details/114766008