# 数据可视化作业
![](https://www.writebug.com/myres/static/uploads/2022/9/19/aa4c5d765af7bd7b48d9a599db0f90b0.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/028207fc14881107fb6c44dc20dac340.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/74cb54dba5e03f840b66feb176525d75.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/ae4a5c63ee96adbeb41732983144e0d2.writebug)
## 解决方案
1.设置图大小
![image-20220919100137778](C:\Users\17625\AppData\Roaming\Typora\typora-user-images\image-20220919100137778.png)
1200×1200像素
2.定义散点颜色,对花类别去重
![image-20220919100151839](C:\Users\17625\AppData\Roaming\Typora\typora-user-images\image-20220919100151839.png)
3.创建数组 order1和 order2 用于按顺序绘制 16个子图
![image-20220919100214429](C:\Users\17625\AppData\Roaming\Typora\typora-user-images\image-20220919100214429.png)
4.绘制子图并添加标题和 x、y轴标签,设置网格线
![](https://www.writebug.com/myres/static/uploads/2022/9/19/896687ba92be937d3778008470013336.writebug)
## 最终图形
![](https://www.writebug.com/myres/static/uploads/2022/9/19/a49a8f8e893b45a0906ea0792a215f3c.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/77eeb789a1a61dc525232968aacb1cf2.writebug)
## 解决方案
选择数据来自 Kaggle题目,泰坦尼克号上乘客的个人信息,文件名 train.csv
![](https://www.writebug.com/myres/static/uploads/2022/9/19/cf3bc272b7fe30e9ce6fd7b131a5c61e.writebug)
2.只对乘客年龄一列进行数据分析![](https://www.writebug.com/myres/static/uploads/2022/9/19/7b17c9bc8a2a1e0283e3ecd7bf3e0d43.writebug)
3. 首先试着以 10 岁为跨度进行分析并绘制饼图
![](https://www.writebug.com/myres/static/uploads/2022/9/19/635d1899151e22e18f6446dff506f67a.writebug)
##
![](https://www.writebug.com/myres/static/uploads/2022/9/19/a12147f0a7f1fa0bf6837c59f66092fb.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/a7c607b44370875b3adb6ba0dcb54ec8.writebug)
以 20岁为跨度进行年龄划分,并绘制饼图,调整起始角度为 0(12点),开启阴影,圆内文本距圆心距离 0.5倍圆心距,标签文本距圆心 1.2倍圆心距,设置标题
## 最终图形
![](https://www.writebug.com/myres/static/uploads/2022/9/19/f9e61358abdd907e071ccee6cae2649f.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/94dec73f1c27edceefeb98563398132b.writebug)
作业要求
解决方案
以最后一列公办本科大学数量代表本省大学数量,取得该数据
![](https://www.writebug.com/myres/static/uploads/2022/9/19/5e4a4bb2a6b34c8307b83f83edce8442.writebug)
调用 pyecharts库生成 map.html
![](https://www.writebug.com/myres/static/uploads/2022/9/19/d2d5e7a79e30a677eaf6caaa2eb331f1.writebug)
## 最终图形
![](https://www.writebug.com/myres/static/uploads/2022/9/19/319aa6e1b1194ccd0d9ec8b537cb4490.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/70ebaf451560d6e9c02d0c0e88ff35fe.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/b9a08f2d15c0dfa292c7f8c8a30efafe.writebug)
在中国天气网查询淮南市 12月 5日到 12月 14日天气,并记录在 values中
![](https://www.writebug.com/myres/static/uploads/2022/9/19/93baa09b42497b04cdd042c1c42b30d9.writebug)
调用 pyecharts库对每一天的数据生成 html并截图成 png
![](https://www.writebug.com/myres/static/uploads/2022/9/19/47cf351cfc67e71d4a35bc9096f328a9.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/312b2099d9167008c2e47fed56a6ffba.writebug)
将 10张 png合成成一张 gif
![](https://www.writebug.com/myres/static/uploads/2022/9/19/00649ab1e4267253bade4fa2c2ba1632.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/cc8aaae463e5cba455925fce1178191e.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/1a75b40275801bead6fc0875689fd903.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/78f59114a87e18ef0986433fa9d7d051.writebug)
最终图形
生成的 gif链接
![](https://www.writebug.com/myres/static/uploads/2022/9/19/2183c1324919e57bdef90b28d9a89dc0.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/c1b96b3cf50f4c858b306d90d5ee9958.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/44c166b15af192c3615e36b25e996935.writebug)
```c++
https://b1.sbimg.org/file/chevereto-jia/2020/12/14/QcJWK.gif
```
作业五
作业要求
解决方案
![](https://www.writebug.com/myres/static/uploads/2022/9/19/10ff2c5fa884f872af2f2c79fca0914d.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/897815fcdf66156c509b93fedefc2b18.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/9aa5d6de29d9d85289e96f75968220ac.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/1a609d84efb914735f92ca07293ec158.writebug)
设置生成 3D图,x轴、y轴、z轴标签
根据题目要求生成 x轴、y轴、z轴数据
绘制 3D图
最终图形
作业六
![](https://www.writebug.com/myres/static/uploads/2022/9/19/3f59429ffad2f529f4a92ffe0af5f8f1.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/12389617542eaee88ec85f712398c383.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/cf900e1f07d125e828203a76ca166917.writebug)
作业要求
解决方案
设置 3D图视角,x轴、y轴、z轴标签
首先绘制单个金字塔,因为无法一笔画完,最后需返回再连线,设置 x、y、z轴数据
绘制 3D图
绘制上下两个金字塔并叠在一起
![](https://www.writebug.com/myres/static/uploads/2022/9/19/57e73493355e02f79ba0a66dfee2695f.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/332590aefe88fc175c1d1a856a2b6074.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/bb2e48f762a06e59a1bc579ceb589fb6.writebug)
最终图形
作业七
![](https://www.writebug.com/myres/static/uploads/2022/9/19/54c432ab9826c782949ea8d4f324da5d.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/30ed470871382d63a3974989f9922e22.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/12dcca148f1941381744fed1c83c5817.writebug)
作业要求
解决方案
设置 x轴、y轴、z轴标签、图标题和角度
根据图形设置 x轴、y轴、z轴数据
绘制散点图
最终图形
![](https://www.writebug.com/myres/static/uploads/2022/9/19/13218c53832810d0e30ee2cf1b580f88.writebug)
![](https://www.writebug.com/myres/static/uploads/2022/9/19/bd0c0f5ea51efe99ab4608850a7f9dbb.writebug)
## 附 录
```c++
import pandas as pd
import numpy as np
import imageio
import math
import random
import matplotlib
import matplotlib.pyplot as plt
from pyecharts import options as opts
from pyecharts.charts import Map
from pyecharts.render import make_snapshot
from snapshot_phantomjs import snapshot
from pyecharts.charts import Geo
from pyecharts.globals import ChartType
from mpl_toolkits.mplot3d import Axes3D
def job1():
plt.rcParams['figure.figsize'] = (12.0, 12.0)
# 读取数据
iris = pd.read_csv('iris.csv')
print(iris)
colors = ['r', 'y', 'b'] # 定义三种散点的颜色
Species = iris.Species.unique() # 对类别去重
print(Species)
order1=['Sepal.length','Sepal.width','Petal.Length','Petal.Width']
order2=['Petal.Width','Petal.Length','Sepal.width','Sepal.length']
for r in range(4):
for c in range(4):
plt.subplot(4,4,4*r+c+1)
for i in range(len(Species)):
plt.scatter(iris.loc[iris.Species == Species[i], order1[r]],
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本次大作业主要有使用IRIS 数据集,在一个figure中绘制出右侧的16个子图。选择数据来自 Kaggle题目,泰坦尼克号上乘客的个人信息以 20岁为跨度进行年龄划分,并绘制饼图,调整起始角度为 0(12点),开启阴影,圆内文本距圆心距离 0.5倍圆心距,标签文本距圆心 1.2倍圆心距,设置标题,展示自己既爱像所在城市的温度变化热力图
资源推荐
资源详情
资源评论
收起资源包目录
100011626-基于Python实现数据可视化作业.zip (36个子文件)
python4
debug.log 96B
数据可视化作业2-报告.pdf 2.12MB
中国大学数量.csv 960B
12月8日.html 4KB
12月10日.html 4KB
10.png 1.72MB
9.png 1.72MB
3.png 1.72MB
main.py 6KB
LICENSE 1KB
huainan.gif 446KB
12月9日.html 4KB
12月6日.html 4KB
1.png 1.72MB
render.html 4KB
12月7日.html 4KB
.idea
dataVisualization2.iml 284B
misc.xml 192B
inspectionProfiles
Project_Default.xml 427B
profiles_settings.xml 174B
modules.xml 288B
12月13日.html 4KB
map.html 7KB
6.png 1.72MB
12月14日.html 4KB
12月5日.html 4KB
5.png 1.72MB
4.png 1.72MB
8.png 1.72MB
train.csv 59KB
12月12日.html 4KB
iris.csv 5KB
7.png 1.72MB
README.md 13KB
2.png 1.72MB
12月11日.html 4KB
共 36 条
- 1
神仙别闹
- 粉丝: 2679
- 资源: 7667
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- video_20240515_132356_edit.mp4
- (python源码)(基于torch框架)基于LSTM的时间序列预测算法实现
- Java 实现CRC码算法(含实现原理和步骤)
- Screenshot_2024-05-15-15-51-23-937_com.tencent.mm.jpg
- gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner
- content_1715761104170.m3u8
- 202391630110 贾增林.zip
- (python源码)基于症状的心脏病预测算法实现
- c# 反编译工具ILSpy 新版
- ESP8266-01模块继电器制作手机APP远程遥控智能开关
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页