当前位置:网站首页>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()
边栏推荐
- How to determine the authenticity of the website you visit -- certificate system
- 吉他五线谱联系 茉莉花
- Exam summary on July 15, 2022
- NFS service and Samba service deployment
- Excel file reading and writing (creation and parsing)
- 我,35岁了。
- Burp Suite-第八章 如何使用Burp Intruder
- Let's talk about the three core issues of concurrent programming.
- Summarize the common high-frequency interview questions of the software testing post
- Implementation class under map interface
猜你喜欢
分享高压超低噪声LDO测试结果(High Voltage Ultra-low Noise LDO)

Burp suite Chapter 6 how to use burp spider

宇宙第一 IDE 霸主,换人了。。。

线程崩了,为什么不会导致 JVM 崩溃呢?如果是主线程呢?

Use js to count the number of occurrences of each string in the string array, and format it into an object array.

Brief introduction to XML

2022-07-08 group 5 Gu Xiangquan's learning notes day01

要不你给我说说什么是长轮询吧?

Burp Suite - Chapter 2 burp suite proxy and browser settings

Why don't you tell me what long polling is?
随机推荐
分布式相关面试题总结
Lambda and stream
Burp Suite - Chapter 1 burp suite installation and environment configuration
General Dao interface design
OSPF总结
Stm8 official library file download
Let's talk about the three core issues of concurrent programming.
FTP service
Exam summary on July 15, 2022
Implementation class under map interface
No valid host was found when setting up openstack to create an instance There are not enough hosts available. code:500
Recurrence of strtus2 historical vulnerability
Summary of distributed related interview questions
数组的介绍--Array
吉他五线谱联系 茉莉花
2W word detailed data Lake: concept, characteristics, architecture and cases
一文掌握mysql数据库审计特点、实现方案及审计插件部署教程
Understand microservices bit by bit
Burp Suite-第四章 SSL和Proxy高级选项
The difference between FileInputStream and bufferedinputstream