matplotlibrc示例文件声明:
## The font.size property is the default font size for text, given in pts.
## 10 pt is the standard value.
##
## Note that font.size controls default text sizes. To configure
## special text sizes tick labels, axes, labels, title, etc, see the rc
## settings for axes and ticks. Special text sizes can be defined
## relative to font.size, using the following values: xx-small, x-small,
## small, medium, large, x-large, xx-large, larger, or smaller对于那些“特殊文本大小”,pts中的等效值是多少?
发布于 2020-06-09 18:16:23
您也可以很容易地自己计算绝对字体大小。
import matplotlib as mpl
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
t = ax.text(0.5, 0.5, 'Text')
fonts = ['xx-small', 'x-small', 'small', 'medium', 'large',
'x-large', 'xx-large', 'larger', 'smaller']
for font in fonts:
t.set_fontsize(font)
print (font, round(t.get_fontsize(), 2))
plt.close() 输出
xx-small 5.79
x-small 6.94
small 8.33
medium 10.0
large 12.0
x-large 14.4
xx-large 17.28
larger 12.0
smaller 8.33发布于 2020-06-09 18:15:34
https://stackoverflow.com/questions/62288898
复制相似问题