Python fontweight属性对AnchoredText对象没有影响?

Python fontweight属性对AnchoredText对象没有影响?,python,matplotlib,Python,Matplotlib,我试图通过绘制一些文本(请参见下面的代码),但fontwweight属性似乎没有任何效果: 我正在使用Python 3.7.3和matplotlib3.1.0 我错过了什么 由于您选择的字体只有“常规”样式,因此使用不同的字体权重参数不会产生任何影响您是否验证过“Ubuntu Condensed”实际上有一个较轻的字体权重?在任何情况下,fontweight参数本身都可以正常工作。根据快速搜索()只有“常规”选项,因此它符合您的解释,但Kolourpaint允许我在此字体上设置粗体选项。这是

我试图通过绘制一些文本(请参见下面的代码),但
fontwweight
属性似乎没有任何效果:

我正在使用Python 3.7.3和
matplotlib
3.1.0

我错过了什么



由于您选择的字体只有“常规”样式,因此使用不同的字体权重参数不会产生任何影响

您是否验证过“Ubuntu Condensed”实际上有一个较轻的字体权重?在任何情况下,fontweight参数本身都可以正常工作。根据快速搜索()只有“常规”选项,因此它符合您的解释,但Kolourpaint允许我在此字体上设置粗体选项。这是另一回事吗?从几何角度来说,任何字体都很容易加粗。如果没有粗体字体集,许多图形程序都会这样做。但是matplotlib中没有这样的算法,那一定是它。你们中的任何一位想从这些评论中快速做出回答吗?
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredText


ax = plt.subplot(131)
plt.plot([])
anchored_text = AnchoredText(
    "aaa bb ccc", loc=8,
    prop={'family': 'Ubuntu Condensed', 'size': 35, 'fontweight': 'normal'},
    frameon=False)
ax.add_artist(anchored_text)

ax = plt.subplot(132)
plt.plot([])
anchored_text = AnchoredText(
    "aaa bb ccc", loc=8,
    prop={'family': 'Ubuntu Condensed', 'size': 35, 'fontweight': 'bold'},
    frameon=False)
ax.add_artist(anchored_text)

ax = plt.subplot(133)
plt.plot([])
anchored_text = AnchoredText(
    "aaa bb ccc", loc=8,
    prop={'family': 'Ubuntu Condensed', 'size': 35, 'fontweight': 'light'},
    frameon=False)
ax.add_artist(anchored_text)

plt.show()