当前位置:网站首页>Matplotlib常用图表
Matplotlib常用图表
2022-07-01 22:50:00 【冷巷(*_*)】
折线图
可以显示随时间变化而变化的联系数据,因此非常使用于显示在相等时间间隔下数据的趋势。
适用类型
1.基础体温曲线图
2.学生成绩走势图
3.股票走势图
4.月销售统计分析图
5.网站访问量统计图

小小改动一下,更好看了

简单柱状图
又称长条图,柱状图,条状图。是一种以长方形的长度为变量的统计图表。
适用类型
比较两个或以上的数据,适用于较小的数据集分析
语法格式
plt.bar(x,height,width,*,align='center',**kwargs)x是x轴数据
height是柱子高度,也是y轴
align是对齐方式
kwargs是关键字参数,其他可选参数,如color,alpha,label

基本柱状图
用法和什么的差不多
小测一下
准备一下Excel



加下这个,颜色变浅,好看多了

多柱状图
瞅瞅

一条
好的,俩条了
改一改

基本直方图
又称质量分布图,有一系列高度不等的纵向条纹或者线段表示数据分布的情况。
语法
plt.hist(x,bins)x是数据集
bins是统计数据的区间分布


饼形图
常用来显示各个部分在整体所占的比例
语法
plt.pie(x,labels,colors,labeldistance,autopct,startangle,radius,center,textprops)x是每一块饼形图的比例
labels是每一块饼形图外侧显示的说明文字
labeldistance是标记的绘制位置,相对于半径的比例,默认值为1.1
autopct是设置饼形图的百分比,可以使用格式化字符串或format函数
startangle是起始绘制角度,默认是x轴正方向逆时针画起
radius是饼图半径,默认值为1
center是浮点类型的列表,可选参数,默认值为0.0表示图表中心位置
textprops是设置标签和比例文职的格式,字典类型

改一改

边栏推荐
猜你喜欢

2022年R1快开门式压力容器操作考题及答案

Aaai22 | structural tagging and interaction modeling: a "slim" network for graph classification

91. (cesium chapter) cesium rocket launch simulation

leetcode - 287. Find duplicates

CKS CKA ckad change terminal to remote desktop

微信个人小商店一键开通助手小程序开发

使用3DMax制作一个象棋棋子

rviz打开后如何显示实时2D地图
![[机缘参悟-35]:鬼谷子-飞箝篇-远程连接、远程控制与远程测试之术](/img/08/9ecfd53a04e147022dde3449aec132.png)
[机缘参悟-35]:鬼谷子-飞箝篇-远程连接、远程控制与远程测试之术

You probably haven't noticed the very important testing strategy in your work
随机推荐
什么是马赛克?
AAAI22 | 结构标记和交互建模:用于图分类的“SLIM”网络
Cisco test -- the concept and configuration test of routing
Where can the courses purchased by CSDN be accessed
【Swoole系列1】在Swoole的世界中,你将学习到什么?
毕业季,既是告别,也是新的开始
Redis数据类型和应用场景
想请教股票开户要认识谁?在线开户是安全么?
Jerry's records are powered by Vbat with a power supply voltage of 4.2V [chapter]
Zhao Fuquan: to ensure supply in the short term, we should build a safe, efficient and resilient supply chain in the long term
Glass mosaic
证券开户选哪个证券公司比较好,哪个更安全
有些能力,是工作中学不来的,看看这篇超过90%同行
Three development trends of enterprise application from the perspective of the third technological revolution
[micro service sentinel] sentinelresourceaspect details
CADD课程学习(3)-- 靶点药物相互作用
CADD course learning (3) -- target drug interaction
Jerry's question about long press boot detection [chapter]
Jielizhi, production line assembly link [chapter]
91. (cesium chapter) cesium rocket launch simulation