gpt4 book ai didi

matplotlib - 字体大小小于 matplotlib 的 xx-small

转载 作者:行者123 更新时间:2023-12-01 12:36:40 25 4
gpt4 key购买 nike

对于使用 matplotlib 绘图,如何使 fontsize 小于 matplotlib 的 xx-small?非常感谢。

引用:http://matplotlib.org/users/text_props.html

最佳答案

如文档所述,您还可以以磅为单位设置字体大小。因此,如果您将它设置为 4pt,它会小于 'xx-small'

例子:

import matplotlib.pyplot as plt

sizes = [10,8,6,4,'xx-small']

for n,s in enumerate(sizes):
plt.text(0,n,str(s), fontsize=s)

plt.xlim([-0.5, 0.5])
plt.ylim([-1, len(sizes)])
plt.show()

结果: enter image description here

关于matplotlib - 字体大小小于 matplotlib 的 xx-small,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29000581/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com