pyqtgraph

Returning mouse cursor coordinates in PyQtGraph

Deadly 提交于 2019-11-29 14:55:27
问题 I am new to PyQtGraph and want to use it for a speedy visualization of my data acquisition. Previously I was using matplotlib where redrawing the figure was my bottleneck. After transitioning to PyQtGraph, I am currently missing only one functionality of matplotlib. Namely, returning the x-, and y-coordinate of my mouse cursor. How can I call/mimic the return of the x-, and y-coordinates of my mouse cursor in a plot made using PyQtGraph? EDIT! - After implementing the tips of leongold, the

pyqtgraph : how to plot time series (date and time on the x axis)?

▼魔方 西西 提交于 2019-11-29 12:21:07
I want to plot time series with pyqtgraph, and display the date and/or time on the x axis scale, but I couldn't find how to do it. Edit 1 : It seems like I should subclass AxisItem and reimplement tickStrings(). I'll look into this. Edit 2 : Here is how I subclassed AxisItem. The documentation shows how to use the class. from __future__ import print_function from PySide.QtCore import * from PySide.QtUiTools import * from PySide.QtGui import * import pyqtgraph as pg import time ## Reimplements \c pyqtgraph.AxisItem to display time series. # \code # from caxistime import CAxisTime # \# class

implementing pyqtgraph for live data graphing

為{幸葍}努か 提交于 2019-11-28 19:58:45
I am trying to get a live plot of data as it is being collected by an instrument using pyqtgraph. The data collection is handled by the main process this is then passed over a connection to a subprocess that plots it. I am just trying to pass the new data and have it update when the new data is passed. I have tried to implement this by putting the connection read inside the Qt Timer update loop but then I have difficulty passing the graph data (which I want to append to) between successive update cycles. I omitted from the code below, but basically I want to join up successive lots of connData

Maximizing serial communication speed for live plotting data from Teensy 3.2 using Python

佐手、 提交于 2019-11-28 09:42:01
问题 I'm trying to plot data as quickly as possible with Python (PyQtGraph) received from a Teensy 3.2 which is sending analog data over a serial communication. The code can sufficiently plot a test waveform of higher frequencies (sine wave of about 5kHz), but it takes nearly 30 seconds for the plot to show a change in frequency. For example, if the test waveform is turned off, it continues to plot the sine wave for an additional half minute. I've tried performing a "serial flush" to clear out the

The fastest way to add a new data bar with pyqtgraph

☆樱花仙子☆ 提交于 2019-11-28 05:03:57
问题 I'd like to refresh a candle graph in the fastest way. But following the modified sample, I've got to draw whole chart every time even when I add just one new bar. The reason is that the QPainter object is cleared when I call the object again to draw additional data. It can be slow. Literally I'd like to just "add" a bar data. So could anybody kindly teach me how to restart painting or give me good ideas? """ Demonstrate creation of a custom graphic (a candlestick plot) """ import pyqtgraph

Show string values on x-axis in pyqtgraph

戏子无情 提交于 2019-11-27 23:10:29
I want to display string values for ticks on x-axis in pyqtgraph . Right now I am unable to figure out how to do that. Ex: x = ['a', 'b', 'c', 'd', 'e', 'f'] y = [1, 2, 3, 4, ,5, 6] pg.plot(x, y) When I try to pass the string array to the x variable it tries converting that to float and breaks the GUI with the error message. Usually in pyqtgraph when dealing with custom axis strings people subclass AxisItem and override tickStrings with the strings they want displayed. See e.g. pyqtgraph : how to plot time series (date and time on the x axis)? Pyqtgraphs axisitem also has a built in setTicks

What is the easiest way to achieve realtime plotting in pyqtgraph

狂风中的少年 提交于 2019-11-27 18:52:58
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 ? 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: ... pw.plot(x, y, clear=True) pg.QtGui.QApplication.processEvents() Use a QTimer to make repeated calls to a

implementing pyqtgraph for live data graphing

空扰寡人 提交于 2019-11-27 12:36:23
问题 I am trying to get a live plot of data as it is being collected by an instrument using pyqtgraph. The data collection is handled by the main process this is then passed over a connection to a subprocess that plots it. I am just trying to pass the new data and have it update when the new data is passed. I have tried to implement this by putting the connection read inside the Qt Timer update loop but then I have difficulty passing the graph data (which I want to append to) between successive

PyQt connect inside for loop vs. separate calls results in different behavior

两盒软妹~` 提交于 2019-11-27 07:32:07
问题 I'm building a plotting UI that lets a user generate multiple plots from loaded data sets. As part of this the user can add marker lines to their plots to examine (x, y) values by moving those marker lines across the plot. The functions below work fine if the markers are added to each plot separately (i.e. add_marker to Plot1, Plot2, etc. separately via the elif block of code). However, if the "add to all" option is selected, resulting in the usage of the for loop block of code in the add

Show string values on x-axis in pyqtgraph

谁说胖子不能爱 提交于 2019-11-27 03:36:58
问题 I want to display string values for ticks on x-axis in pyqtgraph . Right now I am unable to figure out how to do that. Ex: x = ['a', 'b', 'c', 'd', 'e', 'f'] y = [1, 2, 3, 4, ,5, 6] pg.plot(x, y) When I try to pass the string array to the x variable it tries converting that to float and breaks the GUI with the error message. 回答1: Usually in pyqtgraph when dealing with custom axis strings people subclass AxisItem and override tickStrings with the strings they want displayed. See e.g. pyqtgraph