python - 如何索引和绘制两个图表
解决方案
您需要使用 myplotlib 库并更改变量的数量:
import matplotlib
from matplotlib import pyplot as p
x = [0,1,2,3]
y = [67.28,67.01,66.99,67.5]
x1= [0,1,2,3]
y1= [109,112,230,321]
p.sublot(211) # 2 - number of rows, 1 - number of columns, 1 - plot number
p.plot(x,y)
p.plot(x1,y1)
p.subplot(212)
p.plot(x,y)
p.plot(x1,y1)
p.show()
您可以在此处获取有关如何绘图的更多信息:https ://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py
推荐阅读
- python - 使用结构创建数组时忽略空列
- pine-script - 最高和最低函数长度问题
- macos - Perl 无法在 Mac Big Sur 上安装 Glib
- jwt - jwt 关于 blazor web 程序集和 web api 声明的声明
- visual-foxpro - vfox pro 表达式检查字符串是否存在
- automapper - Automapper - 如何将对象映射到列表
- sql - 如何在postgresql中需要时创建函数并触发创建新分区
- python - 返回包装函数时如何修复“NoneType”对象不可调用?
- mysql - 使用多个 BIT(1) 字段改进 Mysql 查询
- c# - 多声道音频 - C# NAudio Winforms