当前位置:网站首页>matplotlib中文问题
matplotlib中文问题
2022-07-29 00:39:00 【红目香薰】
是matplotlib库中没有中文字体。
那么,咱们安装上也就行了。
1、通过pip安装【anaconda】
pip3 install anaconda
2、加上设置
from matplotlib import pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号Demo示例:
from matplotlib import pyplot as plt
import random
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
# 异常气温变化值
# 0.准备x, y坐标的数据
x = range(100)
y_jiangsu = [random.randint(-50, 60) for i in x]
# 1.创建画布
plt.figure(figsize=(20, 8), dpi=80)
# 2.绘制折线图
plt.plot(x, y_jiangsu)
plt.title("异常温度变化表")
plt.xlabel("温度℃")
plt.ylabel("记录次数")
# 3.显示图像
plt.show()

边栏推荐
- Redis installation, cluster deployment and common tuning
- 过去10年的10起重大网络安全事件
- Digital currency of quantitative transactions - generate foot print factor data
- 了解各种路径
- PlatoFarm社区生态福音,用户可借助Elephant Swap获得溢价收益
- Understand all the basic grammar of ES6 in one article
- Canal实时解析mysql binlog数据实战
- Writing assignment 1
- The solution to keep the height of the container unchanged during the scaling process of the uniapp movable view table
- 北京护照西班牙语翻译推荐
猜你喜欢

嵌入式分享合集23

Read the recent trends of okaleido tiger and tap the value and potential behind it

Flink Postgres CDC
![A ten thousand word blog post takes you into the pit. Reptiles are a dead end [ten thousand word pictures]](/img/aa/a5e7b4516aa395f8d4d0e2eee7d3c7.png)
A ten thousand word blog post takes you into the pit. Reptiles are a dead end [ten thousand word pictures]

Three ways of creating indexes in MySQL

20220728 sorting strings that are not pure numbers

Cookies and sessions

云原生应用综合练习下

Google play APK uploads other international app stores

Docker-compose安装mysql
随机推荐
Self-attention neural architecture search for semantic image segmentation
Redis installation, cluster deployment and common tuning
Code generator
时间复杂度、空间复杂度的学习总结
Docker-compose安装mysql
Canal实时解析mysql binlog数据实战
SQL question brushing: find the employee number EMP with more than 15 salary records_ No and its corresponding recording times t
云原生应用综合练习下
nep 2022 cat
【ManageEngine】局域网监控软件是什么,有什么作用
Google play APK uploads other international app stores
J9数字论:什么因素决定NFT的价值?
Flink SQL Hudi actual combat
Bracket matching test
numpy.where() 用法和np.argsort()的用法
Third party login process of flask Weibo
JS judge whether array / object array 1 contains array / object array 2
Teach you a text to solve the problem of JS digital accuracy loss
[idea] where to use the query field
Flask reports an error: pymysq1.err OperationalError:(1054, “Unknown column ‘None‘ in ‘field list‘“)