matplotlibでプロットを生成しようとしていて、 'stix'フォント(rcParams ['mathtext.fontset'] = 'stix')を使用してテキストから数学テキストへの滑らかなフォントサイズの遷移を持つ。しかし、私の数学記号のいくつかはイタリック(スカラー値)で、一部はイタリック(イタリック)になりたいおよびボールド(テンソル)。私はラテックスレンダリングを使用して解決策を検討したくないので、他のものがうんざりしてしまいます。あなたが最初のラベルは斜体であり、第二のラベルが太字でコードを実行した場合stplixフォントのMatplotlibでイタリックとボールドの両方のスタイルを作成する
from numpy import *
from matplotlib.pyplot import *
# Chaning font to stix
rcParams['mathtext.fontset'] = 'stix'
# Some data to constract this plotting example
datax=[0,1,2]
datay=[8,9,10]
datay2=[8,15,10]
fig, ay = subplots()
ay.plot(datax, datay, color="0.", ls='-', label= r"$F_{\alpha}$")
ay.plot(datax, datay2, color="0.", ls='-', label=r"$\mathbf{F_{\alpha}}$")
# Now add the legend with some customizations.
legend = ay.legend(loc='left', shadow=True)
#frame = legend.get_frame()
#frame.set_facecolor('0.90')
xlabel(r"x label",fontsize=18)
ylabel(r'y label', fontsize=18)
grid()
show()
:
は、私はあなたの問題を描いている小さな例を提供します。 2番目のラベルをどのように太字と斜体にすることができますか?
Problem with math text to be Italic and bold
私はそれが可能ではないと思います。本当のラテックス(すなわち、usetex = True)を使用する必要があるかもしれません。そして、この質問は役に立ちます:https://tex.stackexchange.com/questions/14395/bold-italic-vectors – ImportanceOfBeingErnest