且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

matplotlib xticks标签重叠

更新时间:2023-08-26 21:36:22

您可以尝试更改图形尺寸,xticklabel的尺寸,其旋转角度等.

You can try changing the figure size, the size of the xticklabels, their angle of rotation, etc.

# Set the figure size
fig = plt.figure(1, [20, 8])

# Set the x-axis limit
ax.set_xlim(-1,100)
# Change of fontsize and angle of xticklabels
plt.setp(ax.get_xticklabels(), fontsize=10, rotation='vertical')