我有一个数字,我想使轴标签粗体.问题是,文本包含的数学表达式不会变成粗体字体.其他部分还好.
fig = plt.figure(figsize=(4,3))
predicts = np.random.random(1000)*10e9
plt.plot(predicts,predicts, ".", ms=6)
plt.xlabel("Actual NPV (\$) x$10^9$", fontsize=8, fontweight="bold")
plt.ylabel("Predicted NPV (\$) x$10^9$", fontsize=8, fontweight="bold")
# plt.rcParams["font.weight"] = "regular"
plt.yticks(np.arange(9.4, 10.2, 0.2))
R2 = np.round(r2_score(predicts, predicts),2)
plt.text(x=9.4, y=10, s=f"$R^2$={R2}")
plt.rcParams["font.size"] = 8
fig.tight_layout()
The output is shown in the attached image.
我怎么才能把10的9次方也变成粗体呢?
我试过在轴标签中使用fonitary,但它没有工作.