dis*_*ive 15 python matplotlib
我正在密谋,但发现我需要增加图表下方的区域,以便我可以垂直绘制标签,但字体大小不是那么小.目前,我有:
plt.figure(count_fig) fig, ax = plt.subplots()
rects1 = ax.bar(ind, ratio_lst, width, color='r', linewidth=1, alpha=0.8, log=1)
ax.set_ylabel('')
ax.set_title('')
ax.set_xticks(ind_width)
ax.set_xticklabels(labels_lst, rotation='vertical', fontsize=6)
Run Code Online (Sandbox Code Playgroud)
目前它的工作原理,但标签经常在情节的边缘流失.
tmd*_*son 17
subplots_adjust会做的.您可以使用bottom关键字来获得情节底部的良好位置.
fig.subplots_adjust(bottom=0.2)
Run Code Online (Sandbox Code Playgroud)