[英]How to use latex font only for title and not for axis number on matplotlib
really sorry for this, have been searching this since yesterday and I haven't seen a similar problem.真的很抱歉,从昨天开始一直在搜索这个,我还没有看到类似的问题。
The figure is a bit large, so I only post some relevant part:图有点大,只贴一些相关部分:
plt.rcParams.update({
"text.usetex": True})
font = {'family': 'serif', 'serif': ['Computer Modern'],
'weight' : 'bold',
'size' : 22}
matplotlib.rc('font', **font)
fig = plt.figure(figsize=(15,12))
# set height ratios for subplots
gs = gridspec.GridSpec(5,1, height_ratios=[1, 1, 1, 1, 1])
ax0 = plt.subplot(gs[0])
line0, = ax0.plot(xnew, uf_sm(xnew), color='r', linewidth=2.5)
plt.title("\\boldmath$u _\phi$",fontsize=30)
ax0.set_yticks([0.0, 0.3, 0.6])
now, with this font features, everything works properly except one thing: bold
doesn't work, AND the axis numbers (next to ticks) are very faint, and don't appear good on the pdf.现在,有了这个字体功能,除了一件事之外,一切都正常工作: bold
不起作用,并且轴号(在刻度旁边)非常微弱,并且在 pdf 上看起来不太好。
I have seen that here is no bold
option on latex, so is there a way I can either我已经看到这里没有关于乳胶的bold
选择,所以有没有办法我可以
OR要么
REALLY thank you for your time, hope its not that hard.真的很感谢您抽出宝贵时间,希望不会那么难。
Using no latex in title, I can work with $$
but I get this u:在标题中不使用乳胶,我可以使用$$
工作,但我得到了这个你:
On the other hand, when using usetex= True
I get this u:另一方面,当使用usetex= True
我得到这个你:
which is actually what I want to have这实际上是我想要的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.