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


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

stats function in gnuplot 4.6.1

Started byDom <domenic.forgione56@gmail.com>
First post2013-11-05 19:01 -0800
Last post2013-11-12 16:55 -0800
Articles 3 — 3 participants

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


Contents

  stats function in gnuplot 4.6.1 Dom <domenic.forgione56@gmail.com> - 2013-11-05 19:01 -0800
    Re: stats function in gnuplot 4.6.1 Karl <mail.kfr@gmx.net> - 2013-11-12 13:25 +0100
      Re: stats function in gnuplot 4.6.1 Ethan A Merritt <sfeam@users.sourceforge.net> - 2013-11-12 16:55 -0800

#2191 — stats function in gnuplot 4.6.1

FromDom <domenic.forgione56@gmail.com>
Date2013-11-05 19:01 -0800
Subjectstats function in gnuplot 4.6.1
Message-ID<b71a46a1-d28a-4eb0-b7d9-c20eab8bc2b6@googlegroups.com>
Hello,

I would like to use the stats function, I started with stats.dem which works fine with the data the demo was designed for, but when I use my data, it doesn't work, my data looks like this:

07:41:52 7.8 111.3 359.5 1069.8 119.1 1429.3
07:41:53 89.1 251.3 9015.6 2265.7 340.4 11281.3
07:41:54 27.4 94.2 9958.1 1101.8 121.6 11059.9

I need to find when the maximum value of column 6 and 7 occur (time stamp). I have tried to adapt the code in stats.dem with no luck.


Thanks,
Dom

[toc] | [next] | [standalone]


#2193

FromKarl <mail.kfr@gmx.net>
Date2013-11-12 13:25 +0100
Message-ID<l5t6o7$ffd$1@news.rz.uni-karlsruhe.de>
In reply to#2191
Am 06.11.2013 04:01, schrieb Dom:
> Hello,
> 
> I would like to use the stats function, I started with stats.dem which works fine with the data the demo was designed for, but when I use my data, it doesn't work, my data looks like this:
> 
> 07:41:52 7.8 111.3 359.5 1069.8 119.1 1429.3
> 07:41:53 89.1 251.3 9015.6 2265.7 340.4 11281.3
> 07:41:54 27.4 94.2 9958.1 1101.8 121.6 11059.9
> 
> I need to find when the maximum value of column 6 and 7 occur (time stamp). I have tried to adapt the code in stats.dem with no luck.
> 

What did you try to do this?

I think it just isn´t implemented at the time. If you do

set xdata time
stats "data.dat"

gnuplot says

"Stats command not available in timedata mode"


I guess this shouldn´t be hard to implement, perhaps you can leave a
feature request on gnuplot.sf.net


  Karl

[toc] | [prev] | [next] | [standalone]


#2195

FromEthan A Merritt <sfeam@users.sourceforge.net>
Date2013-11-12 16:55 -0800
Message-ID<l5uila$cme$1@dont-email.me>
In reply to#2193
Karl wrote:

> Am 06.11.2013 04:01, schrieb Dom:
>> Hello,
>> 
>> I would like to use the stats function, I started with stats.dem which
>> works fine with the data the demo was designed for, but when I use my
>> data, it doesn't work, my data looks like this:
>> 
>> 07:41:52 7.8 111.3 359.5 1069.8 119.1 1429.3
>> 07:41:53 89.1 251.3 9015.6 2265.7 340.4 11281.3
>> 07:41:54 27.4 94.2 9958.1 1101.8 121.6 11059.9
>> 
>> I need to find when the maximum value of column 6 and 7 occur (time
>> stamp). I have tried to adapt the code in stats.dem with no luck.
>> 
> 
> What did you try to do this?
> 
> I think it just isn´t implemented at the time. If you do
> 
> set xdata time
> stats "data.dat"
> 
> gnuplot says
> 
> "Stats command not available in timedata mode"


True.  But it's possible to interpret time data using generic
string commands.  I prefer this to timedata mode in any case.

# This converts the time string in column COL to a number of seconds
intime(COL) = strptime("%H:%M:%S",strcol(COL))

# This finds correlation of time (seconds) in col 1 with the value in col 6
stats 'data' using (intime(1)):6

# This prints a time, not necessarily unique, at which the
# maximum value in column 6 occurred
print strftime("%H:%M:%S", STATS_pos_max_y)

That is, I think, what you wanted.  Note that you don't get any
warning if that same maximum time occurs on multiple lines.

	Ethan



> 
> 
> I guess this shouldn´t be hard to implement, perhaps you can leave a
> feature request on gnuplot.sf.net
> 
> 
>   Karl

[toc] | [prev] | [standalone]


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


csiph-web