Questions tagged [pyqtgraph]

High-performance scientific graphics for PyQt.

PyQtGraph is a pure-python graphics and GUI library built on PyQt4 / PySide and numpy. It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching and Qt's GraphicsView framework for fast display. PyQtGraph is distributed under the MIT open-source license.

987 questions
9
votes
1 answer

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 ?
dan_0
  • 599
  • 1
  • 5
  • 17
9
votes
3 answers

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 """ import initExample ## Add path to library (just for…
MikeyB
  • 3,288
  • 1
  • 27
  • 38
8
votes
1 answer

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 x axis does not stretch across the bottom of the…
apogalacticon
  • 709
  • 1
  • 9
  • 19
8
votes
2 answers

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, QtCore import pyqtgraph as pg app = pg.mkQApp() win…
jacg
  • 2,040
  • 1
  • 14
  • 27
8
votes
1 answer

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.PlotWidget or pg.PlotWindow, Alt2 and Alt3 it does not…
Ulf Wållgren
  • 161
  • 2
  • 8
8
votes
1 answer

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 PyQtGraph, I am currently missing only one…
The Dude
  • 3,795
  • 5
  • 29
  • 47
7
votes
2 answers

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.argv) self.w = gl.GLViewWidget() …
Tim Wang
  • 71
  • 1
  • 2
7
votes
0 answers

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 GUI designed in pyqt5. The problem with utilizing…
Jmegan042
  • 251
  • 5
  • 15
7
votes
3 answers

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. I cannot figure out how to do this. Any…
user3276846
  • 93
  • 1
  • 5
7
votes
1 answer

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 be opaque (alpha = 1.0), but when the dots in a…
caleb c.
  • 327
  • 1
  • 8
7
votes
1 answer

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.random.normal(size=1000) y =…
Lucas Santana
  • 89
  • 1
  • 1
  • 2
7
votes
2 answers

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 there's no way to do it with a single plot object,…
shx2
  • 61,779
  • 13
  • 130
  • 153
6
votes
1 answer

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 click start position: x1, y1 Drag mouse in x or y…
mr_js
  • 949
  • 12
  • 29
6
votes
1 answer

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 also show the time, which is also updated in real…
autogyro
  • 69
  • 1
  • 2
6
votes
1 answer

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 right. So far I have each data stream associated with its…
lambcutlet
  • 131
  • 1
  • 5
1
2
3
65 66