pyplot latex显示中文出错问题

首先,批斗其:https://blog.csdn.net/weixin_51095970/article/details/126177107

此人真的。。。。全文解决此问题甚少,而这斯,居然开VIP文章,实属可恶!

如今我已解决latex无法显示中文之问题,现分享与诸位。官方文档(https://matplotlib.org/stable/users/explain/text/mathtext.html#custom-fonts)有写到:

 

 

OK,问题重现:

 可见omega的下标没有显示“外”字。且(报错Font 'rm' does not have a glyph for '\u5916' [U+5916], substituting with a dummy symbol.)

那么如何之解决呢?那当然是按照官方给予方法操作之!

我们使用以下代码便可解决之!

plt.rcParams.update({
   'font.sans-serif': 'SimHei',
'mathtext.fontset': 'custom', 'mathtext.rm': 'SimHei' })

 

 

最后,感谢你阅读我的文章!感谢!感恩!

 

posted @ 2024-08-03 00:39  晓星晨曦  阅读(6)  评论(0编辑  收藏  举报