curve = pg.PlotCurveItem(x,y)
plt.addItem(curve)
for each different line I want to add to the plot
My question is, is there anyway to add a set of lines in one go (without looping over .additem or .plot)? So that I have to call pyqtgraph less often and hopefully reducing the effect of this slow down?
I may have misunderstood the cause for the performance issues and if that's the case, any advice that would allow me to plot around 100,000 lines (with around 100 points each) would be much appreciated, I don't need to do any re-scaling or pull any data from the graph, just plot it out to look at so things can be very static.
I realise the scope of plot is quite large so if its something you do not think is reasonable with pyqtgraph I understand.
Thanks,
Hi there,I'm trying to plot a series of particle paths using pyqtgraph as it's performing much better than the packages I've used before so thank you for all the work that has gone into it so far.Unfortunately I want to plot many many lines and have noticed that as I add more lines to the plot there is an exponential performance decrease that brings the program to its knees before 100,000 lines (although it can cope with 10,000). I'm relatively new to python but I'm assuming this is due to some sort of append/pushback function requiring a complete data copy every time I add a new line.
currently I'm creating a plot & window and then using:curve = pg.PlotCurveItem(x,y)
plt.addItem(curve)
for each different line I want to add to the plot
My question is, is there anyway to add a set of lines in one go (without looping over .additem or .plot)? So that I have to call pyqtgraph less often and hopefully reducing the effect of this slow down?
import pyqtgraph as pgimport numpy as npplt = pg.plot()lines = 10000points = 100x = np.empty((lines, points))x[:] = np.arange(points)y = np.random.normal(size=(lines, points))connect = np.ones((lines, points), dtype=np.ubyte)connect[:,-1] = 0 # disconnect segment between linespath = pg.arrayToQPath(x.reshape(lines*points), y.reshape(lines*points), connect.reshape(lines*points))item = pg.QtGui.QGraphicsPathItem(path)item.setPen(pg.mkPen('w'))plt.addItem(item)
I may have misunderstood the cause for the performance issues and if that's the case, any advice that would allow me to plot around 100,000 lines (with around 100 points each) would be much appreciated, I don't need to do any re-scaling or pull any data from the graph, just plot it out to look at so things can be very static.
I don't need to be able to interact with the graph at all (no pan/zoom or axis scaling). I just want to plot and show all the lines with some sort of reasonable update rate (around every few seconds) and then save the final image to a file(which I can already do). As you can see the lines largely overlap so could we optimize with removing covered lines or doing a image save/reload?
import pyqtgraph as pgimport numpy as npplt = pg.plot()
lines = 100000pointsPerLine = 100linesPerItem = 1000numItems = lines/linesPerItempointsPerItem = linesPerItem * pointsPerLinex = np.empty((linesPerItem, pointsPerLine))x[:] = np.arange(pointsPerLine)x = x.reshape(pointsPerItem)connect = np.ones(pointsPerItem, dtype=np.ubyte)connect[pointsPerLine-1::pointsPerLine] = 0 # disconnect segment between linesy = np.random.normal(size=(lines*pointsPerLine))for i in range(numItems):path = pg.arrayToQPath(x, y[pointsPerItem*i:pointsPerItem*(i+1)], connect)
item = pg.QtGui.QGraphicsPathItem(path)item.setPen(pg.mkPen('w'))plt.addItem(item)
Hi there,please i request you to have some patience to listen my problem statement and I am new on this kind of projects and also i also hope not be asking dump questions.i have 8 sensors in my project and that data i stored in Excel and it will be updated for 1ms and updated data i am taking it in text file (read-write ) and then i am plotting same updated text(Aw1.txt) in graph.i have created PYQT5 GUI Application(AW.txt) and then i wrote code for reading and writing the data in python.please can anyone tell me how to plot the graph in qt designer and how to all 8 sensor data .i dont no how to select the check box and how to click the plot and pause button for plotting the graph..please can anyone help me.
Thanks,