有没有办法改变 MatplotLib 中 sublopts 的大小?

Is there a way to change the size of sublopts in MatplotLib?

我有下一个树状图代码

plt.subplot(1,3,1)
plt.title('Enlace Promedio')
plt.xlabel('ID del Usuario de Netflix', fontsize=10)
plt.ylabel('Distancia', fontsize=10)
dendrogram(z_average,leaf_font_size=10)

plt.subplot(1,3,2)

plt.title('Enlace Simple')
plt.xlabel('ID del Usuario de Netflix', fontsize=10)
plt.ylabel('Distancia', fontsize=10)
dendrogram(z_simple,leaf_font_size=10)


plt.subplot(1,3,3)

plt.title('Enlace de Ward')
plt.xlabel('ID del Usuario de Netflix', fontsize=10)
plt.ylabel('Distancia', fontsize=10)
dendrogram(z_ward,leaf_font_size=10)
plt.show()

这个输出

如何更改每个子图的大小?

是的,你可以使用,

f, axs = plt.subplots(figsize=(a,b))

然后在 a,b 所在的位置选择尺码

参考:

How do I change the figure size with subplots?