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

标签 matplotlib

对于使用 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/

相关文章:

python - 具有函数 matplotlib 的多个图

python - 添加覆盖 twinx 轴线条的图例

python - 如何为散点图绘制平均线

python - Pandas 子图布局在这种情况下不起作用

python - 将颜色向量传递给 matplotlib-Basemap

python - matplotlib:每个 x 轴刻度的分组误差线

python - 在循环中保存带有文本的多个 Matplotlib 图像时重叠文本

pandas - 使用 seaborn 绘图时如何为色调参数指定多个变量?

python - Seaborn 折线图样式导致重复的图例条目

python - 具有基于列名称的图例的 T-SNE 散点图