gpt4 book ai didi

python-2.7 - 如何解决用户警告: findfont: Could not match :family=Bitstream Vera Sans

转载 作者:行者123 更新时间:2023-12-02 09:06:20 25 4
gpt4 key购买 nike

已关注 this example :

import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure()
for i, label in enumerate(('A', 'B', 'C', 'D')):
ax = fig.add_subplot(2,2,i+1)
ax.text(0.05, 0.95, label, transform=ax.transAxes,
fontsize=16, fontweight='bold', va='top')

plt.show()

我得到这个输出:

enter image description here

为什么我的标签是正常重量,而文档显示这应该创建粗体字母 ABCD

我也收到此警告:

Warning (from warnings module):
File "C:\Python27\lib\site-packages\matplotlib\font_manager.py", line 1228
UserWarning)
UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=italic:variant=normal:weight=bold:stretch=normal:size=x-small. Returning C:\Python27\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf

OP 分辨率

最佳答案

尝试使用weight而不是fontweight

关于python-2.7 - 如何解决用户警告: findfont: Could not match :family=Bitstream Vera Sans,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18812646/

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