制作散点图时,中文无法显示
用代码块功能插入代码,请勿粘贴截图
我的代码
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
df=pd.read_csv('F:\jupyter\example2_4.csv',encoding='gbk')
sns.set_style('darkgrid')
sns.jointplot(x=df['总股本'],y=df['每股收益'],marker='.',
kind='reg',
height=5,
ratio=3,
data=df)
运行结果及报错内容 :D:\anaconda\lib\site-packages\seaborn\axisgrid.py:1740: UserWarning: Glyph 24635 (\N{CJK UNIFIED IDEOGRAPH-603B}) missing from current font.
f.tight_layout()
D:\anaconda\lib\site-packages\seaborn\axisgrid.py:1740: UserWarning: Glyph 32929 (\N{CJK UNIFIED IDEOGRAPH-80A1}) missing from current font.
f.tight_layout()
D:\anaconda\lib\site-packages\seaborn\axisgrid.py:1740: UserWarning: Glyph 26412 (\N{CJK UNIFIED IDEOGRAPH-672C}) missing from current font.
f.tight_layout()
D:\anaconda\lib\site-packages\seaborn\axisgrid.py:1740: UserWarning: Glyph 27599 (\N{CJK UNIFIED IDEOGRAPH-6BCF}) missing from current font.
f.tight_layout()
D:\anaconda\lib\site-packages\seaborn\axisgrid.py:1740: UserWarning: Glyph 25910 (\N{CJK UNIFIED IDEOGRAPH-6536}) missing from current font.
f.tight_layout()
D:\anaconda\lib\site-packages\seaborn\axisgrid.py:1740: UserWarning: Glyph 30410 (\N{CJK UNIFIED IDEOGRAPH-76CA}) missing from current font.
f.tight_layout()
<seaborn.axisgrid.JointGrid at 0x1e135dec7f0>
D:\anaconda\lib\site-packages\IPython\core\pylabtools.py:151: UserWarning: Glyph 24635 (\N{CJK UNIFIED IDEOGRAPH-603B}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
D:\anaconda\lib\site-packages\IPython\core\pylabtools.py:151: UserWarning: Glyph 32929 (\N{CJK UNIFIED IDEOGRAPH-80A1}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
D:\anaconda\lib\site-packages\IPython\core\pylabtools.py:151: UserWarning: Glyph 26412 (\N{CJK UNIFIED IDEOGRAPH-672C}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
D:\anaconda\lib\site-packages\IPython\core\pylabtools.py:151: UserWarning: Glyph 27599 (\N{CJK UNIFIED IDEOGRAPH-6BCF}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
D:\anaconda\lib\site-packages\IPython\core\pylabtools.py:151: UserWarning: Glyph 25910 (\N{CJK UNIFIED IDEOGRAPH-6536}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
D:\anaconda\lib\site-packages\IPython\core\pylabtools.py:151: UserWarning: Glyph 30410 (\N{CJK UNIFIED IDEOGRAPH-76CA}) missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
具体体现在最后的图的文字无法显示
做了好几幅图,有一些可以显示有一些又不可以显示,报错的有重新打过代码也有直接复制没报错的图的代码,但是都不ok