Questions tagged [pyqtgraph]
High-performance scientific graphics for PyQt.
pyqtgraph
1,011
questions
20
votes
1
answer
27k
views
What is the easiest way to achieve realtime plotting in pyqtgraph
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 ?
18
votes
2
answers
19k
views
Plotting large arrays in pyqtgraph
For an electrophysiology data analysis set I need to plot a large 2D array (dim approx 20.000 x 120) of points. I used to embed a Matplotlib widget in my PyQt application, but went looking for other ...
14
votes
5
answers
26k
views
Error "QObject::startTimer: QTimer can only be used with threads started with QThread" many times when closing application
I know this has been asked many times before. I read all of those threads, and my case seems different. Everybody else who has this trouble has a few straightforward causes that I think I’ve ruled out,...
14
votes
1
answer
633
views
Pyqt4-pyqtgraph application recursively opens new instances of itself
I forked BMDanalyse for my project and have modified it.
Setup Instructions in case you need a hand. Actual question follows this.
A 64-bit system is required due to memory requirements. Please ...
13
votes
3
answers
11k
views
Plotting Datetime objects with PyQtGraph
I am new to PyQtGraph and need help plotting datetime objects on the x-axis which can easily be done with matplotlib. Any help would be appreciated.
As a simple version of what Id like to do see ...
13
votes
0
answers
1k
views
How to update pyqtgraph image data when zooming, translating, resizing
I'm using PySide. Inside a QMainWindow, I have an ImageItem displayed inside a PlotWidget.
Suppose I have a function generateImage(r, np) that can dynamically generate an image. The function returns ...
12
votes
3
answers
45k
views
Python pyqtgraph how to set x and y axis limits on graph, no autorange
I would like to know how I can set the x and y axis limits that are displayed for a pyqtgraph.GraphicsWindow.addPlot object. I need to display a lot of data inside a loop (hence using pyqtgraph) but I ...
11
votes
1
answer
6k
views
How can I use DateAxisItem of PyQtGraph?
I'm using PyQtGraph '0.9.8+gd627e39' on Python 3.6.2(32bit) and Windows 10.
My goal is to plot real time data with an X-axis that shows datetime.
Time ...
10
votes
4
answers
19k
views
Show string values on x-axis in pyqtgraph
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)
...
10
votes
3
answers
28k
views
pyqtgraph: add legend for lines in a plot
I'm using pyqtgraph and I'd like to add an item in the legend for InfiniteLines.
I've adapted the example code to demonstrate:
# -*- coding: utf-8 -*-
"""
Demonstrates basic use of LegendItem
"""
...
10
votes
3
answers
3k
views
PyQtGraph opening then closing straight away
I'm running some basic code from the documentation
import pyqtgraph as pg
import numpy as np
x = np.arange(1000)
y = np.random.normal(size=(3, 1000))
plotWidget = pg.plot(title="Three plot curves&...
10
votes
1
answer
3k
views
pyqtgraph axes not displaying correctly
I recently started working with PyQt5 after updating pyqt from PyQt4 to PyQt5, and have noticed a persistent error in the axis location of all plots produced with pyqtgraph (see attached figure). The ...
9
votes
1
answer
8k
views
Slider widget for PyQtGraph
Is it possible to get a slider widget for PyQtGraph? So that e.g. one or more widgets could control parameters from a plot. Like in this example below (made with enaml/chaco):
I could find nothing ...
9
votes
1
answer
18k
views
How to plot two real-time data in one single plot in PyQtGraph?
I am willing to get 2 random data and plot it in the same Widget using PyQtGraph in a real-time way. I want them to show up as Red and Blue dots. However, after a hard time, my script does not work.
...
9
votes
1
answer
9k
views
Embedding PyQtGraph in Qt without generating new Window
I do not get how to embed PyQtGraph in my MainWindow without generating a new window like it is done by using
pg.plot(...)
What is the easiest way for doing that ?
9
votes
3
answers
3k
views
finplot as a widget in layout
I am trying to add finplot, https://pypi.org/project/finplot/, as a widget to one of the layouts in my UI. I created a widget for finplot and added it to the widgets in the layout but I get the ...
9
votes
5
answers
6k
views
How to add custom AxisItem to existing PlotWidget?
I'm trying to add custom AxisItem in pyqtgraph to existing PlotWidget that was generated by Qt Designer. There is related topic here, but there is no exact answer with code example and I cannot ...
9
votes
1
answer
2k
views
How write \latex character in pyqtgraph?
I'm using pyqtgraph and I would like to write some formula on the graphs. How to write with the latex synthax? matplolib get its own TeX expression parser, but I can't find the solution for pyqtgraph.
8
votes
1
answer
4k
views
Zoom only in x or y direction in pyqtgraph using mouse
I'm using pyqtgraph, which has out of the box zoom behaviour using the mouse wheel. However for my application I need to zoom in the x or y direction only.
I wish to do the following:
Detect mouse ...
8
votes
1
answer
14k
views
Returning mouse cursor coordinates in PyQtGraph
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 ...
8
votes
2
answers
4k
views
Pyqtgraph: where to find signal for key preses?
The following example shows how to connect an arbitrary python callable to mouse motion events in a GraphicsWindow. How would you do the same for key press events?
from pyqtgraph.Qt import QtGui, ...
8
votes
3
answers
5k
views
pyqtgraph: maintain constant position of TextItem while scaling
I would like a TextItem that maintains a constant position on the graph while scaling the y-axis, essentially the same functionality as legend only as a TextItem where I can change the text as needed. ...
8
votes
1
answer
6k
views
How to set tick labels in python pyqtgraph PlotWidget
I am trying to plot a time series of a few hours per day date without blank time between each day. It works fine if I use pg.GraphicsWindow.The tick labels are 9:00 10:00 ..17:00. If I use pg....
7
votes
2
answers
11k
views
Two Y-scales in pyqtgraph (twinx-like)
How can I generate a plot with two Y-scales in pyqtgraph?
I also need the two in different colors (corresponding to lines' colors).
In matplotlib it can be done using twinx, as in this example.
If ...
7
votes
2
answers
2k
views
PyQtGraph GLScatterPlotItem: How to make colors opaque
In PyQtGraph, GLScatterPlotItem, I would like the points to not blend color together when the points overlap. I want to see the closest point, and not the ones behind.
I have asked for the colors to ...
7
votes
2
answers
4k
views
Pyqtgraph & Changing color base on height for surfaceplot
I am looking for a way to make my surface plot item to change color base on height. Below is my current method:
def __init__(self, s):
self.traces = dict()
self.app = QtGui.QApplication(sys....
7
votes
3
answers
5k
views
PyQtGraph - how do I close a plot window/close all plot windows?
I tried pg.close() but that didn't work, couldn't find it in the manual. I produce plots in a loop, so I'd like to close them all at the end of each loop (instead it pops a new window open until my ...
7
votes
1
answer
22k
views
pyqtgraph - ImportError: No module named pyqtgraph
Recently I downloaded pyqtgraph module. I ran the build and install after extract the folder, however when I ran a simple example like under here
import pyqtgraph as pg
import numpy as np
x = np....
7
votes
0
answers
1k
views
Visualization in pyqtgraph for node network?
I have a collection of network points stored as Nodes and Edges for use in networkx, but would like to impliment a more advanced visualzation tool into the pyqtgraph widget so that I can use it in a ...
6
votes
2
answers
31k
views
python realtime plot using pyqtgraph
I need to plot in realtime a series floating point numbers from the serial port. These values are sepparated by the '\n' character, so the data sequence is something like this:
x1
x2
...
6
votes
3
answers
3k
views
pyqtgraph: synchronize scaling of axes in different plots
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 ...
6
votes
3
answers
13k
views
Issue in setting the background color in pyqtgraph
I've got an issue when using the pyqtgraph module in python.
When I put a white background color to a glscatterplot, the scatter dots just vanish. It is like if the color of background was added to ...
6
votes
1
answer
12k
views
Fast, Real-time plotting of points using pyqtgraph and a LiDAR
I want to create a real-time, point plotting GUI. I am using the Scanse Sweep LiDAR, and at each sweep of this LiDAR (working between 1 - 10Hz) I receive approximately 1000 points (x, y) describing ...
6
votes
2
answers
6k
views
How to get basic interactive pyqtgraph plot to work in IPython REPL or Jupyter console?
Typing
import pyqtgraph as pg
pg.plot([1,2,3,2,3])
into the standard Python REPL opens a window containing a plot of the data. Typing exactly the same code into the IPython REPL or the Jupyter ...
6
votes
3
answers
1k
views
How to draw "two directions widths line" in matplotlib
How to use matplotlib or pyqtgraph draw plot like this:
Line AB is a two-directions street, green part represents the direction from point A to point B, red part represents B to A, width of each part ...
6
votes
2
answers
5k
views
How to make the X-axis time dynamically refresh by using pyqtgraph TimeAxisItem
I'm going to make a real-time curve out of a sequence of data. First, I established a quantity dictionary, which has 3 groups of data. The current program can draw a curve dynamically. The X-axis can ...
6
votes
1
answer
13k
views
How to keep PyQt Grid elements from resizing and maintain even spacing of all widgets?
I am having some trouble keeping the size even across all elements in my gridLayout.
Ocasionally the inner widgets just completely change size after I update the plot data (on both width and height), ...
6
votes
1
answer
4k
views
pyqtgraph plotwidget multiple Y axis plots in wrong area
I have an embedded widget in a QT5 gui connected via PlotWidget.
I am trying to plot 2 streams of live data Voltage (self.p1) & Current (self.p2). Voltage on the left axis & Current on the ...
6
votes
1
answer
3k
views
pyqtgraph: save / export 3d graph
I have plotted a 3D graph with pyqtgraph, and I want to save / export it.
A right mouse click on the 3D plot doesn't open any context menu which would allow me to save the plot.
The doc at http://www....
5
votes
1
answer
10k
views
pyqtgraph: Multiple y-axis on left side?
I have found the MultiplePlotAxes-example in pyqtgraph
and extended it with one more y-axis (see code below).
So there are 3 y-axis on the right side now.
Is there a way to get all 3 y-axis from the ...
5
votes
2
answers
12k
views
Embedding "Figure Type" Seaborn Plot in PyQt (pyqtgraph)
I am using a wrapper of PyQt (pyqtgraph) to build a GUI application.
I wish to embed a Seaborn plot within it using the MatplotlibWidget. However, my problem is that the Seaborn wrapper method such ...
5
votes
1
answer
7k
views
Implementing pyqtgraph multiprocessing into a pyqt widget
I am trying to plot images on a GUI that I am designing in Python. The full program will be collecting image data from a camera and then displaying the images on the GUI. I have explored using ...
5
votes
1
answer
16k
views
implementing pyqtgraph for live data graphing
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 ...
5
votes
1
answer
3k
views
PyQtGraph stops updating and freezes when grapahing live sensor data
I am using PyQt5 and pyqtgraph to plot live sensor data. This graph is part of a bigger PyQt5 application which is used to interact with various hardware and also visualize the sensor data.
Background:...
5
votes
3
answers
2k
views
How can I launch pyqt GUI multiple times consequtively in a process?
How can I architect code to run a pyqt GUI multiple times consecutively in a process?
(pyqtgraph specifically, if that is relevant)
The context
A python script that performs long running data ...
5
votes
1
answer
3k
views
None values in pyqtgraph
I am trying to make a graph from a data which includes null value (data from pandas) using pyqtgraph.
pyqtgraph - yellow circle has null values
graph using excel
i want the graph using pyqtgraph ...
5
votes
1
answer
5k
views
How to set logarithmic scale and axis limits in HistogramLUTItem in pyqtgraph
I'm using pyqtgraph for a live view of a camera acquisition program. Most of the times my images are composed of a lot of background noise and a signal of just a few pixels with higher intensity. For ...
5
votes
2
answers
6k
views
How to set a PyQtGraph GraphicView window to maximized state
I am trying to create a GraphicView() window to open in "maximized" state in order to fill the entire screen. But I didn't find so far any clue in PyQtGraph's documentation on how to do it
I managed ...
5
votes
1
answer
10k
views
How to draw crosshair and plot mouse position in pyqtgraph?
I am new to Python and pyqtgraph. I am working on a viewer for different kinds of signals. Currrently I got stuck when I want to include a crosshair and a text label with the mouse position. I am ...
5
votes
1
answer
14k
views
Multiple updating plot with pyqtgraph in Python
I have to plot 3 updating curves of data I read from a sensor. The updating plot is very fast when I use just a curve but when I try to plot them all each of them is drastically slower. The code I use ...