首页 > 解决方案 > 这种类型的情节叫什么?

问题描述

这种类型的情节叫什么,有没有办法在 matplotlib 或 seaborn 中实现它?

在此处输入图像描述

资料来源:https ://oec.world/en/profile/country/tkm

标签: matplotlibplotseaborn

解决方案


它被称为树图。您可以使用squarify创建它。

示例

import matplotlib.pyplot as plt
import squarify

squarify.plot(sizes=[13,22,35,5], label=["group A", "group B", "group C", "group D"], alpha=.7 )
plt.axis('off')
plt.show()

在此处输入图像描述


推荐阅读