我用python中的matplotlib作图,但子图上下间距太近,遮挡了横坐标,请问一下要怎么处理才能将上下间距调大,能显示出所有子图的横坐标。
下面是我作图的代码:
def density_plot(data): #自定义作图函数
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
p = data.plot(kind='kde', linewidth = 2, subplots = True, sharex = False)
[p[i].set_ylabel('density') for i in range(k)]
plt.legend()
return plt
density_plot(df_x[r0[u'聚类类别']==0])