pyqtgraph

Live Data Monitor: PyQtGraph

纵饮孤独 提交于 2019-12-21 02:07:06
问题 I am working on a project where I will have to analyse signals coming from a device. I have a library working which gets me data from the device. As of now, I am collecting the data and then plotting it. I am interested in building a live data monitor which can plot a graph in real time. Upon searching, I figured out PyQtGraph is ideal for the task. I am not familiar with Qt, so I am looking for examples which I can modify to my needs. Some examples given in PyQtGraph docs update the plot

How to display clickable RGB image similar to pyqtgraph ImageView?

廉价感情. 提交于 2019-12-20 03:44:06
问题 Despite not being a proficient GUI programmer, I figured out how to use the pyqtgraph module's ImageView function to display an image that I can pan/zoom and click on to get precise pixel coordinates. The complete code is given below. The only problem is that ImageView can apparently only display a single-channel (monochrome) image. My question: How do I do EXACTLY the same thing as this program (ignoring histogram, norm, and ROI features, which I don't really need), but with the option to

What is the easiest way to achieve realtime plotting in pyqtgraph

若如初见. 提交于 2019-12-17 15:35:55
问题 I do not get how to achieve realtime plotting in pyqtgraph. The realisation of that is not implemented in the documentation yet. Could anyone please provide an easy example ? 回答1: Pyqtgraph only enables realtime plotting by being quick to draw new plot data. How to achieve realtime plotting is highly dependent on the details and control flow in your application. The most common ways are: Plot data within a loop that makes calls to QApplication.processEvents(). pw = pg.plot() while True: ...

PyCharm doesn’t display plots and is very slow

谁都会走 提交于 2019-12-14 03:08:05
问题 I am trying PyCharm for the first time and have troubles to display my plots. Can you tell me what I missed ? I grouped 2 questions in the same post because I have the feeling it's in fact the same bug, but I'm not sure. I'm using python 3.7 under mac OS 10.11.6 (El Capitan) and don't want to upgrade. Problem: with the same code, opening a python console in PyCharm and making a basic plot works but is very slow (several seconds for the basic example below, why ?), while running it directly

Read and plot real time live self updating csv file

无人久伴 提交于 2019-12-13 03:37:42
问题 So, I have a .csv file which updates itself. I would like to do some things with it and am not sure how to approach it, hope you can help me. The data in the csv looks like this: There is no headers. I can join the date and time to be in same column without a delimiter too. 07/12/2017,23:50,113.179,113.182,113.168,113.180,113.187,113.189,113.176,113.186,144 07/12/2017,23:51,113.180,113.190,113.180,113.187,113.186,113.196,113.186,113.193,175 07/12/2017,23:52,113.187,113.188,113.174,113.186,113

Integrating two event handling programs in Python

£可爱£侵袭症+ 提交于 2019-12-13 02:52:46
问题 I have two programs in Python. Let's call them Prog1.py and Prog2.py . Prog1 is helping me get live data from an external device. As of now, as and when it gets the data it prints it on the screen. There is a while loop running where in each iteration it prints out the new set of data acquired. Now Prog2 is a Python program built using PyQtGraph which is intended to plot the data real time like that of a monitor. As of now what Prog2 does is that (that is, when it is run separately), it plots

pyqtgraph: synchronize scaling of axes in different plots

谁说我不能喝 提交于 2019-12-12 05:39:55
问题 I want to synchronize the X-Axis of several pyqtgraph plots. When the user rescales the X-Axis with mouse interactions (e.g. scroll-wheel while mouse on x-Axis) I want to assign the same changes to all the other plots. So how do I do this? I derived a minimized code from a basic example below. Do I have to overwrite the viewRangeChanged() functions of w1 and w2 ? import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph.console import numpy as np from pyqtgraph.dockarea

pyqtgraph change color of node and its edges on click

拟墨画扇 提交于 2019-12-12 04:59:48
问题 I'm working with pyqtgraph to create an interactive network of nodes and edges (initially from this question, all code needed comes from here). I'm trying to change the color of a node and its neighbors (edges and other nodes it is connected to) when clicking on that node. The code below shows how to get the node which was clicked as well as its edges and other nodes it is connected to. Now, I don't understand how one can change the color of specific pyqtgraph scatterplot items. In the code

pyqtgraph get text of node and change color on MouseClick

我怕爱的太早我们不能终老 提交于 2019-12-12 04:39:53
问题 I found this example from the pyqtgraph github repo. I would like to create an interactive (network) graph with pyqtgraph with the following functionality: When the user clicks on a node, he/she will get the 'text'-info of that node. When a node was clicked the color of that node, as well as of all its neighbors (edges and nodes) will change (e.g. to yellow) Allow for multiple selection Code: # -*- coding: utf-8 -*- """ Simple example of subclassing GraphItem. """ import initExample ## Add

PyQtGraph - How to set intervals of axis

家住魔仙堡 提交于 2019-12-12 04:29:18
问题 Below is a function I have written that create a graph based on a list of tuples of scores (scores and their frequency) def initialise_chart(self, scores): pg.setConfigOption("background", "w") pg.setConfigOption("foreground", "k") results_graph = pg.PlotWidget() self.chart_results.addWidget(results_graph) results_graph.plot([i[0] for i in scores], [i[1] for i in scores], pen={'color': "#006eb4"}) results_graph.setLabels(left="Frequency", bottom="Scores") results_graph.setXRange(0, self.max