PyQtGraph在pyqt中的应用及安装过程
作者:whatapp88 时间:2022-02-27 17:00:14
1.PyQtGraph简介:
pyqtgraph的主要用途:
1、为数据、绘图、视频等提供快速、可交互图形显示。
2、提供快速开发应用的工具。
2.PyQtGraph的安装:
pip install pyqtgraph
安装完成之后执行如下代码可以看到官方示例。
import pyqtgraph.examplespyqtgraph.examples.run()
官方示例如图:
3.设置提升的窗口控件
将QWidget窗口控件拖动到主窗口中,然后对提升的窗口进行设置,如下图所示
把QWidget控件重命名为pyqtgraph
然后上代码。。。
def init_plot(self):
self.p1 = self.pyqtgraphl1.addPlot(title="温度")
self.curve1 = self.p1.plot(pen='r')
self.p1_list = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
def update_plot(self):
# rand = random.randrange(0, 100)
del self.p1_list[0]
self.p1_list.append(self.ch0) #添加最新的数据
self.curve1.setData(self.p1_list) #设置图表的纵坐标数据
if self.ptr == 0: #规定吧
pass
self.p1.enableAutoRange('xy', False) ## stop auto-scaling after the first data set is plotted
self.ptr += 1
总结
以上所述是小编给大家介绍的PyQtGraph在pyqt中的应用,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!
来源:https://blog.csdn.net/whatapp88/article/details/88598807
标签:PyQtGraph,pyqt
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
opencv-python基本图像处理详解
2021-07-07 04:37:02
![](https://img.aspxhome.com/file/2023/3/131673_0s.jpg)
FrontPage XP设计教程3——网页的布局
2008-10-11 12:20:00
![](https://img.aspxhome.com/file/UploadPic/200810/17/20081017122538589s.jpg)
python打印n位数“水仙花数”(实例代码)
2021-06-11 20:35:36
详解Python 多线程 Timer定时器/延迟执行、Event事件
2022-09-04 11:12:52
一些Python中的二维数组的操作方法
2022-10-21 16:14:42
Python基础 while循环与break、continue关键字
2023-11-19 03:41:42
![](https://img.aspxhome.com/file/2023/3/64283_0s.jpg)
python,pycharm的环境变量设置方式
2023-08-04 10:44:41
![](https://img.aspxhome.com/file/2023/0/101060_0s.png)
PHP面向对象程序设计子类扩展父类(子类重新载入父类)操作详解
2023-10-15 01:41:57
python+requests+unittest API接口测试实例(详解)
2021-10-14 13:15:08
![](https://img.aspxhome.com/file/2023/4/65124_0s.jpg)
详细介绍Python中的偏函数
2022-12-28 08:40:53
Python微信库:itchat的用法详解
2022-02-17 10:54:33
![](https://img.aspxhome.com/file/2023/3/105863_0s.png)
asp常用的SQL命令操作
2007-09-29 12:21:00
python中的tkinter库弹窗messagebox详解
2023-11-12 04:02:05
![](https://img.aspxhome.com/file/2023/5/64625_0s.png)
MySQL 查询缓存的实际应用代码示例
2010-06-11 12:04:00
pytorch中的embedding词向量的使用方法
2022-03-25 09:05:27
使用python编写批量卸载手机中安装的android应用脚本
2022-07-04 19:41:27
软件与网站设计的区别
2009-05-04 14:30:00
php连接MySQL的两种方式对比
2023-11-16 23:34:26
ThinkPHP3.1.2 使用cli命令行模式运行的方法
2023-11-14 12:56:27
![](https://img.aspxhome.com/file/2023/5/94505_0s.png)
Python实现Socket通信建立TCP反向连接
2023-11-13 04:20:19
![](https://img.aspxhome.com/file/2023/9/86419_0s.jpg)