脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服务器之家 - 脚本之家 - Python - python中pyqtgraph知识点总结

python中pyqtgraph知识点总结

2021-08-29 11:06十一 Python

在本篇文章里小编给大家整理的是一篇关于python中pyqtgraph知识点总结内容,有兴趣的朋友们可以学习下。

PyQtGraph是纯Python的,只是它底层调用的是PyQt,也就是Qt的Python封装,底层用C/C++语言开发的库,它是在PyQt的基础上开发的可视化控件,相较于老牌的绘制库,PyQtGraph在绘图速度上特别突出,保证绘图的美观性以及强大功能前提下,能够极高的效率去绘制图形,下面一起来详细了解下使用技巧吧。

pyqtgraph库安装:

?
1
pip install --user pyqtgraph

更快安装方式:

?
1
pip3.8 install -i https://mirrors.aliyun.com/pypi/simple

导入方式:

?
1
import pyqtgraph as pg

自带实例模块:

?
1
python -m pyqtgraph.examples

绘制折线图:

?
1
2
3
4
5
6
7
8
9
10
11
12
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
from pyqtgraph.widgets.RemoteGraphicsView import RemoteGraphicsView
app = pg.mkQApp()
v = RemoteGraphicsView(debug=False)
v.show()
v.setWindowTitle('单1的折线图')
plt = v.pg.PlotItem()
v.setCentralItem(plt)
y1=[1,4,2,3,6,2,3,4,2,3]
plt.plot(y1, pen='g')
QtGui.QApplication.instance().exec_()

效果展示:

python中pyqtgraph知识点总结

到此这篇关于python中pyqtgraph知识点总结的文章就介绍到这了,更多相关python中pyqtgraph是什么内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文链接:https://www.py.cn/jishu/gaoji/23309.html

延伸 · 阅读

精彩推荐