pyqtgraph

How to increase speed and split data with multiple plots using PyQtGraph?

家住魔仙堡 提交于 2020-01-06 05:36:08
问题 I am reading datas from serial port using an STM32 kit. Problem is that I need to use own timestamp for plot ADC datas. That is mean x-axis should be my RTC time(using ms for this) and y-axis is ADC datas. There are programs for plot serial port but as I said I need to set own time for graph. I tried matplotlib for this but it was really slow. Then have used pyqtgraph and this script: from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph as pg from pyqtgraph.ptime import

PyQtgraph y axis label non scientific notation

≯℡__Kan透↙ 提交于 2020-01-05 05:31:13
问题 PyQtgraph Y axis label is displaying in scientific notation. I do not want it to be in scientific notation. What is the code to change label to non scientific. Scientific notation - 1.70 (x1e+06) non Scientific notation 1700000 (I want to display Y axis in non scientific notation). from main() function I call addXYZ to add contour lines, then I call Show2dPlot to display the contour map plot. ##### add the XY contour line to plot ##### def addXYZ(self, X, Y, Z): self.plotwin.plot(X, Y, pen=

Implementing pyqtgraph multiprocessing into a pyqt widget

放肆的年华 提交于 2019-12-30 05:05:55
问题 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 matplotlib, but it was too slow for my application. I need the plot to update rather quickly (preferably as fast as I can acquisition from the camera, once ever half second or second). This is challenging with pyqt because it seems that even when using a QThread, the plot can only update on the main

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

五迷三道 提交于 2019-12-29 08:11:49
问题 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

Arduino Live Serial Plotting with a MatplotlibAnimation gets slow

醉酒当歌 提交于 2019-12-26 03:14:05
问题 I am making a live plotter to show the analog changes from an Arduino Sensor. The Arduino prints a value to the serial with a Baudrate of 9600. The Python code looks as following: import matplotlib.pyplot as plt import matplotlib.animation as animation import serial import time ser = serial.Serial("com3", 9600) ser.readline() optimal_frequency = 100 fig = plt.figure(figsize=(6, 6)) ax1 = fig.add_subplot(1, 1, 1) # the following arrays must be initialized outside the loop xar = [] yar = []

PyQtGraph: Live video stream freezes using ImageView

匆匆过客 提交于 2019-12-25 02:29:05
问题 Hi everyone, I'm writing a GUI for a camera and I'd like to have a widget with the live stream from the camera. Following one of the examples, I'm doing it this way: def updateview(): global img, camera img.setImage(camera.most_recent_image(camera.detector_shape)) win = QtGui.QWidget() # Image widget imagewidget = pg.GraphicsLayoutWidget() view = imagewidget.addViewBox() view.setAspectLocked(True) img = pg.ImageItem(border='w') view.addItem(img) view.setRange(QtCore.QRectF(0, 0, 512, 512))

error with IPython in showing plots with pyqtgraph

Deadly 提交于 2019-12-24 17:27:29
问题 i have successfully installed pyqtgraph library in python 2.7. I forked latest project from GitHub and then python setup.py install . I am now trying to show plots with it. I open a python terminal and start typing the following:- import pyqtgraph as pg import numpy as np x = np.random.normal(size=1000) y = np.random.normal(size=1000) All of these commands are successfully interpreted. But then i run the command to see the plot as:- pg.plot(x, y, symbol='o') It outputs: <pyqtgraph

How to obtain the highest sample rate possible in Raspbery Pi using a ADC?

亡梦爱人 提交于 2019-12-24 01:13:55
问题 I am working in a project using Raspberry Pi 3 B where I get data from a IR sensor(Sharp GP2Y0A21YK0F) through a ADC MPC3008 and display it in real-time using PyQtgraph library. The datasheet of the ADC says that at 5.0V, the sampling rate is 200khz. However I am only getting about 30 samples per second. Is it possible to achieve 200khz using Raspberry pi? If yes, what should I study or implement in order to obtain it? If not, what should I do to obtain the highest sample rate possible and

pyqtgraph limit zoom to upper/lower bound of axes

假装没事ソ 提交于 2019-12-23 16:41:03
问题 so Pyqtgraph automatically computes the axis and rescales upon zooming, and this is fine. However I have two axes, frequency and hour. Frequency can take any value between 0-100 and hour can take any value between 0-39. How can I limit the axis to these upper/lower bounds so that when the user zooms or pans they cannot go outside of these values? My code is as follows (for 3 lines, my actual code will plot a lot more): from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph

How to update a realtime plot and use buttons to interact in pyqtgraph?

帅比萌擦擦* 提交于 2019-12-21 23:09:51
问题 I used the "scrolling graph" example from pyqtgraph.examples as template to create a plot, which shows a continuous sinus wave. Now, I would like to use buttons to change the amplitude of the sinus wave. This is why I used another structure (see the code below). This doesn't work, it only plots a static sinus wave. How can I use my update function to plot the continuous sinus wave? How can I chage the amplitude by using the buttons? I have already checked this and this without success. import