|
From: Glenton J. <gle...@go...> - 2010-04-15 08:01:13
|
Hi All ******************************************************************** Summary of question: Is there a way to send a single data point to append to an existing series. Ie a graph exists with a single series of n data points, and I was to update it so that there's a single series of n+1 data points. ******************************************************************** Details of question: I'm using gnuplot to visualise data as they are collected from an experiment. I'm doing this via python (Gnuplot.py). Currently, it's being done in a way that I consider to be inefficient: 1. I have lists of the x and y data, and use the plot command to plot them. 2. When I get new data, I append the new data to the lists, and then plot them, which deletes the existing data and plots the whole lot again. In other words, I might have 1000 data points plotted, and when I get my 1001st data point, I clear the 1000 data points and then plot 1001 data points (which is implied with the plot command) Is it possible to simply add the 1001st data point to the existing graph somehow? Not as a new series, of course, but appended to the existing series? Thanks Glenton ******************************** PS: Of course, using replot, I could add a new series of 1 data point, formated to look the same. I somehow think that this is even less efficient. Any thoughts on this option? I attach two files: * liveGraphing2.py shows the python code for plotting the whole file. It takes about 10.2 seconds to plot 100 data points with 0.1 second delay between each. * liveGraphing2b.py using replot to plot just the latest additional data point as a new series. It takes about 12.2 seconds to plot the same 100 data points with a 0.1 second delay - ie computational overhead takes about eleven times longer. (Without the delay it gets itself confused and crashes) |