UserWarning: Glyph 28857 (\N{CJK UNIFIED IDEOGRAPH-70B9}) missing from current font. FigureCanvasA

简介: UserWarning: Glyph 28857 (\N{CJK UNIFIED IDEOGRAPH-70B9}) missing from current font. FigureCanvasA

问题记录与解决



在PyCharm中使用matplotlib绘图时,图形中的中文无法正常显示:

遇到如下问题:

707fde2d7b4e49da90d4f4edd41b5607.jpg


解决



在代码最上方引入以下代码即可:

import matplotlib
matplotlib.rc("font", family='Microsoft YaHei')


已成功解决 ~

相关文章
|
14天前
|
Python
UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
本文提供了解决PIL库中"Palette images with Transparency"警告的方法,通过将图片转换为'RGB'模式来消除透明通道的问题。
UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
|
2月前
|
Ubuntu Linux Python
UserWarning: Glyph 27668 (\N{CJK UNIFIED IDEOGRAPH-6C14}) missing from current font.
UserWarning: Glyph 27668 (\N{CJK UNIFIED IDEOGRAPH-6C14}) missing from current font.
121 2
|
4月前
解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
58 5
|
机器学习/深度学习 PyTorch 算法框架/工具
【完美解决】RuntimeError: one of the variables needed for gradient computation has been modified by an inp
将loss.backward()函数内的参数retain_graph值设置为True, loss.backward(retain_graph=True),如果retain_graph设置为False,计算过程中的中间变量使用完即被释放掉。
1507 0
|
数据可视化 数据挖掘 开发者
Data-Basic Statistical Descriptions of Data| 学习笔记
快速学习 Data-Basic Statistical Descriptions of Data。
135 0
Data-Basic Statistical Descriptions of Data| 学习笔记
成功解决ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C h
成功解决ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C h
成功解决ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C h
|
Web App开发
How to trouble shoot if there is no entityset available when creating a tile
How to trouble shoot if there is no entityset available when creating a tile
How to trouble shoot if there is no entityset available when creating a tile
header note truncation issue - designed behavior
header note truncation issue - designed behavior
102 0
header note truncation issue - designed behavior
|
JavaScript 前端开发