3

在 Matplotlib 中,我可以通过

ax.text(x_coord, y_coord, string, bbox = dict(boxstyle='round'), wrap = True, fontproperties = FontProperties_object)

我也可以通过设置字体类型matplotlib.font_manager.FontProperties

与 相比squarify,它看起来很相似,因为正方形内有文字。我将如何设置字体并使用 进行文本换行squarify?谢谢。

4

1 回答 1

1

我试过这个并且它有效。

text_kwargs={"fontproperties": FontProperties_object}. 文本选项以 'dict' 形式给出,如

https://github.com/laserson/squarify/blob/master/squarify/init .py _

于 2019-02-25T08:15:13.530 回答