当前位置:网站首页>matplotlib学习笔记
matplotlib学习笔记
2022-07-26 08:10:00 【浑浑噩噩666】
import numpy as np
# matplotlib
import matplotlib.pyplot as plt
def plot(x,y,*args):
ax, title, xlabel, ylabel, legend = args
ax.set_title(title)
ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
ax.plot(x,y,'.')
ax.legend([legend], 'upper right')
fig, axes = plt.subplots(3,2)
# 点线图
x = np.linspace(-np.pi, np.pi, 100)
axes[0,0].plot(x, np.sin(x), '.', color='red')
# 柱状图
x = np.arange(1,10)
# axes[0,1].bar(x, x, color='green', align='center')
axes[0,1].barh(x, x, color='green', align='center')
# 饼图
x = np.array([1,2,3])
axes[1,0].pie(x, explode=[0.1,0,0] , labels=['A', 'B', 'C'])
# 直方图
x = np.array([1,2,2,3,3,3])
axes[1,1].hist(x, color = 'yellow', align='left')
# 箱线图
x = np.array([1,2,3,4,5,6])
axes[2,0].boxplot(x)
# 散点图
x = np.array([1,2,3,4,5,6])
axes[2,1].scatter(x, x)
# 保存图片
# plt.savefig('test.png')
plt.show()
边栏推荐
- BGP选路原则
- Zroi easy sum (generating function, block, DP, combination, polynomial)
- 2022-07-08 group 5 Gu Xiangquan's learning notes day01
- utils 连接池
- 一键部署LAMP和LNMP架构
- Rewriting and overloading
- Establishment and use of openstack cloud platform
- The difference between abstract classes and interfaces
- 2022/7/9 exam summary
- The first ide overlord in the universe, replaced...
猜你喜欢

小蜜蜂吉他谱 高八度和低八度

2w字详解数据湖:概念、特征、架构与案例

Burp Suite-第五章 如何使用Burp Target

Understand microservices bit by bit

Rack server expansion memory

Burp suite Chapter 6 how to use burp spider

Summary of distributed related interview questions

The most complete network: detailed explanation of six constraints of MySQL

一点一点理解微服务

万字长文 | 深入理解 OpenFeign 的架构原理
随机推荐
PHP environment deployment
Burp suite Chapter 4 advanced options for SSL and proxy
How to close the high-level port
Software engineering -- dental clinic -- demand analysis
SPSS用KMeans、两阶段聚类、RFM模型在P2P网络金融研究借款人、出款人行为规律数据
Burp suite Chapter 7 how to use burp scanner
Summary of distributed related interview questions
通用 DAO 接口设计
Team members participate in 2022 China multimedia conference
JSP implicit object servlet object
The difference between abstract classes and interfaces
Stack simulation queue
The difference between ArrayList and LinkedList
Utils connection pool
IDEA settings设置快捷键实现字符串中的英文字母转大小写
Implementation class under map interface
2022 / 7 / 16 exam summary
Shardingjdbc pit record
1. MySQL Architecture [MySQL advanced]
Unity metaverse (II), mixamo & animator hybrid tree and animation fusion