Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2745 > unrolled thread

Re: Continuous plotting of data in real time

Started bymuhammad.mustafa88@gmail.com
First post2015-02-10 00:51 -0800
Last post2015-02-10 17:21 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Continuous plotting of data in real time muhammad.mustafa88@gmail.com - 2015-02-10 00:51 -0800
    Re: Continuous plotting of data in real time Karl <mail.kfr@gmx.net> - 2015-02-10 17:21 +0100

#2745 — Re: Continuous plotting of data in real time

Frommuhammad.mustafa88@gmail.com
Date2015-02-10 00:51 -0800
SubjectRe: Continuous plotting of data in real time
Message-ID<4902f6f9-6852-46b4-9b29-70cfec4c4c18@googlegroups.com>
On Monday, October 18, 2010 at 4:56:36 PM UTC+2, Anal Patel wrote:
> Hi,
> 
> I'm plotting data in real time, and would like to plot sets of data
> over each other on same plot.
> Currently, I'm plotting one set after another like:
> gnuplot> plot "-"
> input data ('e' ends) > 2 3
> input data ('e' ends) > 4 5
> input data ('e' ends) > 6 7
> input data ('e' ends) > e
> 
> Each set of data that I plot clears the previous set and plots only
> new set.
> I would like to take this one step further, where I would like to see
> the history of sets of data on same plot, i.e. all the sets of data
> are plotted on same graph. I took an approach of buffering old sets of
> data and then issuing plot command with old and new set of data to
> achieve this. But quickly it came to a point where gnuplot was very
> slow and could not handle writing so many sets of data. In my case
> each set of data arrive in 20ms interval, and there could be thousands
> of sets.
> 
> Is there a way that gnuplot can remember the previously plotted data
> and then only thing I have to do is issue new set. The users do need
> to see the points in real time, i.e. can't wait until all the sets are
> collected and then issue plot command.
> 
> Thanks-
> Andy Patel

Hi Andy, I am currently facing the same problem. Did you find solution to the problem?

Thanks

[toc] | [next] | [standalone]


#2746

FromKarl <mail.kfr@gmx.net>
Date2015-02-10 17:21 +0100
Message-ID<mbdb5j$ed9$1@news.rz.uni-karlsruhe.de>
In reply to#2745
Am 10.02.2015 um 09:51 schrieb muhammad.mustafa88@gmail.com:
> On Monday, October 18, 2010 at 4:56:36 PM UTC+2, Anal Patel wrote:
>> Hi,
>>
>> I'm plotting data in real time, and would like to plot sets of data
>> over each other on same plot.
>> Currently, I'm plotting one set after another like:
>> gnuplot> plot "-"
>> input data ('e' ends) > 2 3
>> input data ('e' ends) > 4 5
>> input data ('e' ends) > 6 7
>> input data ('e' ends) > e
>>
>> Each set of data that I plot clears the previous set and plots only
>> new set.
>> I would like to take this one step further, where I would like to see
>> the history of sets of data on same plot, i.e. all the sets of data
>> are plotted on same graph. I took an approach of buffering old sets of
>> data and then issuing plot command with old and new set of data to
>> achieve this. But quickly it came to a point where gnuplot was very
>> slow and could not handle writing so many sets of data. In my case
>> each set of data arrive in 20ms interval, and there could be thousands
>> of sets.
>>
>> Is there a way that gnuplot can remember the previously plotted data
>> and then only thing I have to do is issue new set. The users do need
>> to see the points in real time, i.e. can't wait until all the sets are
>> collected and then issue plot command.
>>
>> Thanks-
>> Andy Patel
> 
> Hi Andy, I am currently facing the same problem. Did you find solution to the problem?
> 

Unlikely, although there are a few ways to speed things up a bit.

Firstly some terminals are faster with displaying that others, depending
on your platform. Just give it a try with qt, wxt, even a bitmap driver
with external viewer? If you have a slow terminal, that might be the
limiting factor.

On the long run, this won´t help, because gnuplot always reprocesses all
data on every "plot" or "replot", including parsing and converting each
line of text data into columns and binary numbers.
It might be an option for you to feed binary data to gnuplot. That could
speed things up to some extent. (i´ve never tried it myself, admittedly,
anyone with first-hand experience?)

Otherwise I'd recommend compressing each incoming dataset into a few
numbers (using "stats" or "fit", for example), print those to a logfile
("set print logfname append"), and then only plot the current dataset
and that logfile. Of course, plotting the logfile also takes
increasingly longer, but you could increase the step width with time

  plot logfname every (int(n/100)+1) # n is number of datasets so far

lines that are not read in take nearly no time.

Or you choose a clever method to always plot only a set of ten or so of
the stored datasets, something like this:

 n = 123 # number of datasets so far, in a while loop?
 fname(n) = "name_".n.".dat"
 imax=10 # plot imax datasets
 num(i) = int(n-n*10**(i/(imax))/10) # or similar/better ;-)
 plot for [i=1:10] fname(num(i)) title sprintf("set nr %.f",num(i)),\
	"-" title "last set"


  Karl

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web