【问题标题】:Is there a way to change the size of sublopts in MatplotLib?有没有办法改变 MatplotLib 中 sublopts 的大小?
【发布时间】:2020-11-04 10:03:07
【问题描述】:

我有下一个树状图代码

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()

这个输出

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

【问题讨论】:

标签: python python-3.x matplotlib cluster-analysis hierarchical-clustering


【解决方案1】:

是的,你可以使用,

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

a,b 在哪里,选择大小

参考:

How do I change the figure size with subplots?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-23
    相关资源
    最近更新 更多