欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

python中pyqtgraph知识点总结

程序员文章站 2022-07-09 18:32:21
pyqtgraph是纯python的,只是它底层调用的是pyqt,也就是qt的python封装,底层用c/c++语言开发的库,它是在pyqt的基础上开发的可视化控件,相较于老牌的绘制库,pyqtgra...

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

pyqtgraph库安装:

pip install --user pyqtgraph

更快安装方式:

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

导入方式:

import pyqtgraph as pg

自带实例模块:

python -m pyqtgraph.examples

绘制折线图:

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是什么内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

相关标签: python pyqtgraph