一、数据可视化与matplotlib (Python数据可视化)

1.数据可视化概述
2.什么是数据可视化
数据可视化是借助图形化的手段将- -组 数据以图形的形式表示,并利用数据分析和开发工具发现其中未知信息的数据处理过程。数据可视化其实是一个抽象的过程,简单来说就是将一个不易描述的事物形成- 个可感知画面的过程,即从数据空间到图形空间的映射。
3.常见的数据可视化方式
折线图、柱形图、条形图、堆积图、直方图、箱型图、饼图、散点图、气泡图、误差棒图、雷达图、统计地图、3D图表
4.选择正确的数据可视化图表1.2 常见的数据可视化库
5.matplotlib概述
6.安装matplotib
在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

7.使用matplotlib绘制图表

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(4,19)
y_min = np.array([32, 33, 34, 34, 33, 31, 30, 29, 30, 29, 26, 23, 21, 25, 31])
plt.plot(x, y_min)
plt.title("2020080603036")
plt.show()


x = np.arange(5)
y1 = np.array([10, 8, 7, 11, 13])
plt.bar(x, y1,width=0.4)
plt.title("2020080603036")
plt.show()

x = np.arange(4,19)
y_min = np.array([32, 33, 34, 34, 33, 31, 30, 29, 30, 29, 26, 23, 21, 25, 31])
y_max = np.array([35, 33, 34, 34, 33, 34, 30, 23, 30, 24, 26, 23, 24, 25, 31])
plt.plot(x, y_min)
plt.plot(x, y_max)
plt.title("2020080603036")
plt.show()


x = np.arange(5)
y1 =np.array([11, 8, 7, 5, 13])
y2 =np.array([3, 5, 6, 8, 16])
plt.bar(x, y1, width=0.4)
plt.bar(x + 0.4, y2, width=0.4)
plt.title("2020080603036")
plt.show()


error = [2, 4, 5, 2.4]
plt.bar(x, y1, width=0.3)
plt.bar(x,y1,bottom=y1,width=0.4)
plt.title("2020080603036")
plt.show()


y = np.arange(5)
x1 =np.array([11, 8, 7, 5, 13])
plt.barh(y, x1, height=0.4)
plt.title("2020080603036")
plt.show()


y = np.arange(5)
x1 =np.array([11, 8, 7, 5, 13])
x2 =np.array([3, 5, 6, 8, 16])
plt.barh(y, x1, height=0.4)
plt.barh(y+0.4, x2, height=0.4)
plt.title("2020080603036")
plt.show()


plt.barh(y, x1, height=0.4)
plt.barh(y, x2, left=x1, height=0.4)
plt.title("2020080603036")
plt.show()

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值