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


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

Create timeline and plot it with binary datas

Started byavd <avd@syscom-instruments.com>
First post2013-03-01 11:53 +0100
Last post2013-03-01 15:19 +0100
Articles 4 — 2 participants

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


Contents

  Create timeline and plot it with binary datas avd <avd@syscom-instruments.com> - 2013-03-01 11:53 +0100
    Re: Create timeline and plot it with binary datas avd <avd@syscom-instruments.com> - 2013-03-01 14:47 +0100
    Re: Create timeline and plot it with binary datas Karl <mail.kfr@gmx.net> - 2013-03-01 14:51 +0100
      Re: Create timeline and plot it with binary datas avd <avd@syscom-instruments.com> - 2013-03-01 15:19 +0100

#1675 — Create timeline and plot it with binary datas

Fromavd <avd@syscom-instruments.com>
Date2013-03-01 11:53 +0100
SubjectCreate timeline and plot it with binary datas
Message-ID<36795$5130890d$3e0c929a$8960@nf39.xennanews.com>
Hello,

I've an issue about creating a time plot with a binary data file which 
has no time value in it. Actually, I can deduce this time value from 
header informations of my binary (I can get the rate between 2 samples: 
by example 1000Hz. So, there 1/1000 second between 2 entries). This part 
isn't a problem. I do that before calling gnuplot. The problem is 
generate the xdata value.

I've trying to use pseudocolumn 0 with $0 and a function to calculate 
the x time coordinate. It's almost working but the scale is wrong. I 
should have a plot with a x range from 00:00 to ~00:03 but I've got one 
from 00:00 to 45:00...

There 2620 samples in my binary file.

Here my gnuplot script:

-----------------------------------
set terminal png linewidth 1 interlace size 800,600
set output "test.png"
set title ' signals / time'
set xlabel ' Time (s) '
set ylabel ' Signals (mm/s) '
set xdata time
set grid
set style data lines
inscale(r)=(r*100)
genx(x)=(x*(1.0/1000))

plot \
  "mydata" binary skip=512 format="%lf%*lf%*lf" using 
genx($0):(inscale($1)) title "x" with lines,\
  "" binary skip=512 format="%*lf%lf%*lf" using genx(\0):(inscale($1)) 
title "y" with lines,\
  "" binary skip=512 format="%*lf%*lf%lf" using genx($0):(inscale($1)) 
title "z" with lines
-----------------------------------

If i record the points generated by gnuplot (with set table), I've got 
this :

-----------------------------------
# Curve 0 of 3, 2620 points
# Curve title: "x"
# x y type
"g"  0.0664117  i
"g"  0.0633014  i
"g"  0.0571437  i
"g"  0.0509914  i
"g"  0.0478949  i
"g"  0.0417508  i
-----------------------------------

Why there "g" for my x data :( ?

Anthony.

[toc] | [next] | [standalone]


#1676

Fromavd <avd@syscom-instruments.com>
Date2013-03-01 14:47 +0100
Message-ID<1134b$5130b1c4$3e0c929a$32481@nf39.xennanews.com>
In reply to#1675
On 01. 03. 13 11:53, avd wrote:
> Hello,
>
> I've an issue about creating a time plot with a binary data file which
> has no time value in it. Actually, I can deduce this time value from
> header informations of my binary (I can get the rate between 2 samples:
> by example 1000Hz. So, there 1/1000 second between 2 entries). This part
> isn't a problem. I do that before calling gnuplot. The problem is
> generate the xdata value.
>
> I've trying to use pseudocolumn 0 with $0 and a function to calculate
> the x time coordinate. It's almost working but the scale is wrong. I
> should have a plot with a x range from 00:00 to ~00:03 but I've got one
> from 00:00 to 45:00...
>
> There 2620 samples in my binary file.
>
> Here my gnuplot script:
>
> -----------------------------------
> set terminal png linewidth 1 interlace size 800,600
> set output "test.png"
> set title ' signals / time'
> set xlabel ' Time (s) '
> set ylabel ' Signals (mm/s) '
> set xdata time
> set grid
> set style data lines
> inscale(r)=(r*100)
> genx(x)=(x*(1.0/1000))
>
> plot \
> "mydata" binary skip=512 format="%lf%*lf%*lf" using
> genx($0):(inscale($1)) title "x" with lines,\
> "" binary skip=512 format="%*lf%lf%*lf" using genx(\0):(inscale($1))
> title "y" with lines,\
> "" binary skip=512 format="%*lf%*lf%lf" using genx($0):(inscale($1))
> title "z" with lines
> -----------------------------------
>
> If i record the points generated by gnuplot (with set table), I've got
> this :
>
> -----------------------------------
> # Curve 0 of 3, 2620 points
> # Curve title: "x"
> # x y type
> "g" 0.0664117 i
> "g" 0.0633014 i
> "g" 0.0571437 i
> "g" 0.0509914 i
> "g" 0.0478949 i
> "g" 0.0417508 i
> -----------------------------------
>
> Why there "g" for my x data :( ?
>
> Anthony.

I found my mistake. I must surround genx($0) with parenthesis !

Like that :

-----------------------------------
set terminal png linewidth 1 interlace size 800,600
set output "test.png"
set title ' signals / time'
set xlabel ' Time (s) '
set ylabel ' Signals (mm/s) '
set xdata time
set grid
set style data lines
inscale(r)=(r*100)
genx(x)=(x*(1.0/1000))

plot \
  "mydata" binary skip=512 format="%lf%*lf%*lf" using 
(genx($0)):(inscale($1)) title "x" with lines,\
  "" binary skip=512 format="%*lf%lf%*lf" using (genx($0)):(inscale($1)) 
title "y" with lines,\
  "" binary skip=512 format="%*lf%*lf%lf" using (genx($0)):(inscale($1)) 
title "z" with lines
-----------------------------------

I understand why I've got "g" in my table...

Anthony.

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


#1677

FromKarl <mail.kfr@gmx.net>
Date2013-03-01 14:51 +0100
Message-ID<kgqbph$goo$1@news.rz.uni-karlsruhe.de>
In reply to#1675
Am 01.03.2013 11:53, schrieb avd:
> plot \
>  "mydata" binary skip=512 format="%lf%*lf%*lf" using
> genx($0):(inscale($1)) title "x" with lines,\


> # Curve title: "x"
> # x y type
> "g"  0.0664117  i
> "g"  0.0633014  i
> "g"  0.0571437  i

> Why there "g" for my x data :( ?

I cannot try now, not having your data, but this should not print at
all, since you´ve got the "using" statment wrong.

There have to be parentheses () around everything that is more than just
a column number.

from "help using":

"Each <entry> may be a simple column number that selects the value from
one field of the input file, a string that matches a column label in the
first line of a data set, an expression enclosed in parentheses, or a
special function not enclosed in parentheses such as xticlabels(2). "

so

gp> plot "" using (genx($0)):(inscale($1))

if your plot command indeed produces this output, then this looks like a
bug in the parser, that you should report.

  Karl

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


#1679

Fromavd <avd@syscom-instruments.com>
Date2013-03-01 15:19 +0100
Message-ID<5130B8EA.9040709@syscom-instruments.com>
In reply to#1677
On 01. 03. 13 14:51, Karl wrote:
> Am 01.03.2013 11:53, schrieb avd:
>> plot \
>>   "mydata" binary skip=512 format="%lf%*lf%*lf" using
>> genx($0):(inscale($1)) title "x" with lines,\
>
>
>> # Curve title: "x"
>> # x y type
>> "g"  0.0664117  i
>> "g"  0.0633014  i
>> "g"  0.0571437  i
>
>> Why there "g" for my x data :( ?
>
> I cannot try now, not having your data, but this should not print at
> all, since you´ve got the "using" statment wrong.
>
> There have to be parentheses () around everything that is more than just
> a column number.
>
> from "help using":
>
> "Each<entry>  may be a simple column number that selects the value from
> one field of the input file, a string that matches a column label in the
> first line of a data set, an expression enclosed in parentheses, or a
> special function not enclosed in parentheses such as xticlabels(2). "
>
> so
>
> gp>  plot "" using (genx($0)):(inscale($1))
>
> if your plot command indeed produces this output, then this looks like a
> bug in the parser, that you should report.
>
>    Karl
>
>

Thanks Karl, this was my mistake :)

Anthony.

[toc] | [prev] | [standalone]


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


csiph-web