当前位置:网站首页>Matplotlib learning notes
Matplotlib learning notes
2022-07-26 08:13:00 【Confused 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)
# Point line diagram
x = np.linspace(-np.pi, np.pi, 100)
axes[0,0].plot(x, np.sin(x), '.', color='red')
# Histogram
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')
# The pie chart
x = np.array([1,2,3])
axes[1,0].pie(x, explode=[0.1,0,0] , labels=['A', 'B', 'C'])
# Histogram
x = np.array([1,2,2,3,3,3])
axes[1,1].hist(x, color = 'yellow', align='left')
# boxplot
x = np.array([1,2,3,4,5,6])
axes[2,0].boxplot(x)
# Scatter plot
x = np.array([1,2,3,4,5,6])
axes[2,1].scatter(x, x)
# Save the picture
# plt.savefig('test.png')
plt.show()
边栏推荐
- 苹果强硬新规:用第三方支付也要抽成,开发者亏大了!
- "Door lock" ignites a heated discussion on the safety of living alone. The new poster picture is suffocating
- Dev gridcontrol captures key events
- Burp Suite-第六章 如何使用Burp Spider
- The difference between FileInputStream and bufferedinputstream
- Abstract classes and interfaces
- CentOS install mysql5.7
- Regular expression job
- flex三列布局
- 给项目日志加上traceid
猜你喜欢

Why don't you tell me what long polling is?

R language foundation

2022-07-14 group 5 Gu Xiangquan's learning notes day07

Dev gridcontrol captures key events

On some concepts involved in journal papers compilation + journal query methods

Software engineering -- dental clinic -- demand acquisition

Ten thousand words long article | deeply understand the architecture principle of openfeign

【 fastjson1.2.24反序列化漏洞原理代码分析】
Share high voltage ultra low noise LDO test results

Introduction to arrays -- array
随机推荐
AQS implementation principle
Burp Suite - Chapter 2 burp suite proxy and browser settings
mysql函数汇总之日期和时间函数
给项目日志加上traceid
JSP built-in object (implicit object) -- input / output object
Burp Suite-第九章 如何使用Burp Repeater
Burp suite Chapter 6 how to use burp spider
[endnote] compilation of document types and abbreviations of document types
vscode国内的镜像服务器加速
Regular expression job
The difference between abstract classes and interfaces
Basic configuration of BGP
A clear summary and configuration example of GPON has been highlighted
Reading and writing properties file
随机分布学习笔记
2022-07-09 group 5 Gu Xiangquan's learning notes day02
The bigger the project is, the bigger it is. This is how I split it
2022-07-13 group 5 Gu Xiangquan's learning notes day06
线程崩了,为什么不会导致 JVM 崩溃呢?如果是主线程呢?
2022/7/11 exam summary