当前位置:网站首页>数据可视化(二)
数据可视化(二)
2022-08-05 10:23:00 【The code family】
- Matplotlib三步绘制:引入pyplot模块;使用Matplotlib模块的plot方法绘制图表;运行程序
这是上篇文章用到的例子
#绘制简单的图表import matplotlib.pyplot as plt plt.plot([1,2,3,4,5,6]) plt.show() #展示图片- 图表常用设置
基本绘图函数:matplotlib.pyplot.plot(x,y,format_string,**kwargs)
参数说明:x:x轴数据 y:y轴数据
format_string:控制曲线格式的字符串,报考颜色,线条样式和标记样式
**kwargs:键值参数,相当于一个字典。
import matplotlib.pyplot as plt import numpy as np xpoints = np.array([0, 3]) ypoints = np.array([0, 20]) plt.plot(xpoints, ypoints) plt.show()
eg.散点图
代码
#散点图
import matplotlib.pyplot as plt plt.plot([1,2,3],[2,1,5],"ro") plt.show()颜色字符:'b' 蓝色,'m' 洋红色,'g' 绿色,'y' 黄色,'r' 红色,'k' 黑色,'w' 白色,'c' 青绿色,'#008000' RGB 颜色符串。多条曲线不指定颜色时,会自动选择不同颜色;
线型参数:'‐' 实线,'‐‐' 破折线,'‐.' 点划线,':' 虚线;
标记字符:'.' 点标记,',' 像素标记(极小点),'o' 实心圈标记,'v' 倒三角标记,'^' 上三角标记,'>' 右三角标记,'<' 左三角标记
边栏推荐
- Why are RELTABLESPACE values 0 for many tables displayed in sys_class?
- SD NAND Flash简介!
- 一个栈的输入序列为1 2 3 4 5 的出站顺序的理解
- PHP 操作mangoDb
- MySQL data view
- GCC编译的时候头文件搜索规则
- 华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)
- 【 temperature warning program DE development 】 event driven model instance
- PCB布局必知必会:教你正确地布设运算放大器的电路板
- Where is your most secretive personality?
猜你喜欢

皕杰报表的下拉框联动
![[Strong Net Cup 2022] WP-UM](/img/3d/caeab05ddca278af274dbf6e2f8ba1.png)
[Strong Net Cup 2022] WP-UM

linux下oracle常见操作以及日常积累知识点(函数、定时任务)

How to choose coins and determine the corresponding strategy research

Jenkins manual (2) - software configuration

JS逆向入门学习之回收商网,手机号码简易加密解析

2022 Huashu Cup Mathematical Modeling Question A Optimization Design Ideas for Ring Oscillators Code Sharing

技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离

什么是 DevOps?看这一篇就够了!

Egg framework usage (2)
随机推荐
【Office】Microsoft Office下载地址合集(微软官方原版离线安装下载)
教你本地编译运行一个IDEA插件,在IDEA里聊天、下棋、斗地主!
【综合类型第 35 篇】程序员的七夕浪漫时刻
Getting started with Polkadot parachain development, this article is enough
JS逆向入门学习之回收商网,手机号码简易加密解析
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
PHP operation mangoDb
Pycharm 常用外部工具
Oracle 19.3 restart 环境
Create a Dapp, why choose Polkadot?
阿里顶级架构师多年总结的JVM宝典,哪里不会查哪里!
SMB + SMB2: Accessing shares return an error after prolonged idle period
Complete image segmentation efficiently based on MindSpore and realize Dice!
19. Server-side session technology Session
第三章 : redis数据结构种类
数据中台建设(十):数据安全管理
three.js debugging tool dat.gui use
IDEA performs the Test operation, resulting in duplicate data when data is inserted
Chapter 4: activiti RuntimeService settings get and get process variables, and the difference from taskService, set process variables when starting and completing tasks [easy to understand]
登录功能和退出功能(瑞吉外卖)