Matplotlib
绘制散点图
-
导入
matplotlib.pyplot
和font_maneger
import matplotlib.pyplot as plt from matplotlib import font_manager
-
设置字体
my_font = font_manager.FontProperties(fname="/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc")
fname
是字体的安装路径,可以通过fc-list
查看字体,fc-list :lang=zh
查看中文字体 -
设置
x
和y
的值y_3 = [11,12,14,15,15,15,12,22,23,15,23,24,34,14,15,30,15,15,16,18,15,12,22,18,33,15,35,15,34,38,39] y_10 = [11,12,23,34,23,25,32,12,23,25,13