字体大小小于 matplotlib 的 xx-small

font size smaller than xx-small of matplotlib

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

参考:http://matplotlib.org/users/text_props.html

如文档所述,您还可以设置 fontsize 点数。因此,如果将其设置为 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()

结果: