我就废话不多说了,直接上代码吧!
from time import sleep
from threading importThread
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets importButton
fig, ax = plt.subplots()
#设置图形显示位置
plt.subplots_adjust(bottom=0.2)
#实验数据
range_start, range_e
我就废话不多说啦,还是直接看代码吧!
from matplotlib import pyplot as plt
import numpy as np
x = np.linspace(1, 100, 20)
y = x *2 +3
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.scatter(x, y)
plt.ion()
for i in range(10):
y = x*i*0.1 + i
try:
ax.lines.remove
代码编辑环境
Win10+(Pycharmm or Vscode)+PyQt 5.14.2
功能实现
静态作图:数据作图,取决于作图函数,可自行修改
动态作图:产生数据,获取并更新数据,最后刷新显示,可用于实现数据实时采集并显示的场景
效果展示
代码块(业务与逻辑分离)业务–UI界面代码
文件名:Ui_realtimer_plot.py
# -*- coding: utf-8 -*-
# Added by the Blog author VERtiCaL on 2020/07/12 at S