pyqtgraph

pyqtgraph, plotting time series

北慕城南 提交于 2019-12-02 01:10:53
I'am trying to plot time serie with pyqtgraph. I've read this , this and this . But i'am not sure how to correctly use it. My plot is a plot widget, and i use it this way: graph.plot(aerosol_data, pen=pg.mkPen(color=colors[count], width=1, style=QtCore.Qt.SolidLine), axisItems={'bottom': TimeAxisItem(orientation='bottom')}) where TimeAxisItem is defined like this: class TimeAxisItem(pg.AxisItem): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def tickStrings(self, values, scale, spacing): # PySide's QTime() initialiser fails miserably and dismisses args/kwargs return

How to display clickable RGB image similar to pyqtgraph ImageView?

∥☆過路亽.° 提交于 2019-12-01 22:50:10
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 display a true color image (e.g., the original JPEG photo)? import numpy as np from pyqtgraph.Qt import

pyqtgraph select 2D region of graph as threshold to redraw the graph

被刻印的时光 ゝ 提交于 2019-12-01 10:50:24
I wish to add functionality such that the user can draw a rectangle over a selection of lines and the graph will refresh such that the lines within the rectangle keep their respective colour and any lines outside turn grey? My code is as follows, and currently zooms on the drawing of a user defined rectangle over the lines, (for 3 lines, my actual code will plot a lot more): from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph as pg pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') from random import randint class CustomViewBox(pg.ViewBox): def _

pyqtgraph select 2D region of graph as threshold to redraw the graph

假如想象 提交于 2019-12-01 09:24:42
问题 I wish to add functionality such that the user can draw a rectangle over a selection of lines and the graph will refresh such that the lines within the rectangle keep their respective colour and any lines outside turn grey? My code is as follows, and currently zooms on the drawing of a user defined rectangle over the lines, (for 3 lines, my actual code will plot a lot more): from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph as pg pg.setConfigOption('background', 'w')

Embedding “Figure Type” Seaborn Plot in PyQt (pyqtgraph)

本秂侑毒 提交于 2019-12-01 06:53:37
问题 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 as FacetGrid do not accept an external figure handle. Moreover, when I try to update the MatplotlibWidget object underlying figure ( .fig ) with the figure produced by the FacetGrid it doesn't work (no plot after draw ). Any suggestion for a workaround? 回答1: Seaborn's Facetgrid provides a

Embed Pyqtgraph to PySide2

ぐ巨炮叔叔 提交于 2019-11-30 23:56:50
I'd like to implement a PyQtGraph PlotWidget into a PySide2 application. With PyQt5 everything works. With PySide2 I get the Error shown at the bottom. I already found out, that there's some work in progress, but also it seems that a few people managed to get this working. However, I was not able yet. I am using Pyqtgraph 0.10 and not the developer branch. Shall I change? What do I need to do? from PySide2.QtWidgets import QApplication, QMainWindow, QGraphicsView, QVBoxLayout, QWidget import sys import pyqtgraph as pg class WdgPlot(QWidget): def __init__(self, parent=None): super(WdgPlot, self

How to plot two real-time data in one single plot in PyQtGraph?

南楼画角 提交于 2019-11-30 18:57:49
问题 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. I would like to know what can I do in order to get both data in the same plot. I know it is a silly question. I am a beginner in Python and coding. Here is my code: #-*- coding: utf-8 -*- import random import time from collections import deque import pyqtgraph as pg from pyqtgraph.Qt import QtCore

Embed Pyqtgraph to PySide2

╄→尐↘猪︶ㄣ 提交于 2019-11-30 18:11:26
问题 I'd like to implement a PyQtGraph PlotWidget into a PySide2 application. With PyQt5 everything works. With PySide2 I get the Error shown at the bottom. I already found out, that there's some work in progress, but also it seems that a few people managed to get this working. However, I was not able yet. I am using Pyqtgraph 0.10 and not the developer branch. Shall I change? What do I need to do? from PySide2.QtWidgets import QApplication, QMainWindow, QGraphicsView, QVBoxLayout, QWidget import

Plotting large arrays in pyqtgraph

巧了我就是萌 提交于 2019-11-30 10:52:15
问题 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 solutions because the plotting took quite long. Still, plotting the data with pyqtgraph also takes much longer then expected, probably because it redraws the widget everytime when using the plot() function. What is the best practice to plot large arrays? The pyqtgraph examples, although extensive,

Plotting large arrays in pyqtgraph

笑着哭i 提交于 2019-11-29 22:40:12
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 solutions because the plotting took quite long. Still, plotting the data with pyqtgraph also takes much longer then expected, probably because it redraws the widget everytime when using the plot() function. What is the best practice to plot large arrays? The pyqtgraph examples, although extensive, didn't help me much further... import pyqtgraph as pg view = pg.GraphicsLayoutWidget() w1 = view