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


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

Lost minutes

Started byvittec@gmail.com
First post2017-01-19 05:12 -0800
Last post2017-01-20 11:17 +0100
Articles 4 — 2 participants

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


Contents

  Lost minutes vittec@gmail.com - 2017-01-19 05:12 -0800
    Re: Lost minutes Karl Ratzsch <mail.kfr@gmx.net> - 2017-01-19 20:53 +0100
      Re: Lost minutes vittec@gmail.com - 2017-01-19 23:52 -0800
        Re: Lost minutes Karl Ratzsch <mail.kfr@gmx.net> - 2017-01-20 11:17 +0100

#3540 — Lost minutes

Fromvittec@gmail.com
Date2017-01-19 05:12 -0800
SubjectLost minutes
Message-ID<566df517-180f-4457-8a64-a899cf76e57f@googlegroups.com>
Hello. I will try to explain my problem. I'm new with gnuplot and also my english is not the best.
Ok i have a .csv file with time and temperature. The values are like this:
18:25:46 , 25.4
I take a value each 5 minutes (not exactly, it changes a few seconds). 
Iam trying to take a graph loading a script, i think is the best way for my project.
The problem is that the graph's points are not distributed as they should. I mean if i have 10 values in the 18 p.m.
(for example:
18:01:45 , 25
18:06:58 , 25.1
18:11:42 , 25.2
18:16:46 , 25.1)
gnuplot does not put them in the intermediate places. It plots all the values in the 18:00:00 column. Just as it takes only the hour parameter.
I have tried some solutions.
set xdata time → It gives me a lot of problems saying that the requires more spec.
set timefmt "%H:%M:%S" → makes the same only in the integer hours
Can anybody help me a little...
Thank you very much.

[toc] | [next] | [standalone]


#3541

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-01-19 20:53 +0100
Message-ID<o5r5f9$q25$1@solani.org>
In reply to#3540
Am 19.01.2017 um 14:12 schrieb vittec@gmail.com:
> Ok i have a .csv file with time and temperature. The values are like this:
> 18:25:46 , 25.4

> The problem is that the graph's points are not distributed as they should. I mean if i have 10 values in the 18 p.m.
> gnuplot does not put them in the intermediate places. It plots all the values in the 18:00:00 column. Just as it takes only the hour parameter.

> set xdata time → It gives me a lot of problems saying that the requires more spec.
> set timefmt "%H:%M:%S" → makes the same only in the integer hours

Hint: Please give a complete script that one can c&p into gnuplot,
including some (a few lines of) data. Saves others a lot of time:

(I assume you have gnuplot >5.0 ? Otherwise the inline data $dat doesn't
work, the rest should.)

=========
$dat << EOD
18:01:45 , 25
18:06:58 , 25.1
18:11:42 , 25.2
18:16:46 , 25.1
EOD

set dataf sep ","
set format x "%H:%M:%S" time # that's the _output_ format
plot $dat us (timecolumn(1,"%H:%M:%S")):2 # that's the _input_ format
=========

You can also set the input format via

  set timefmt "%H:%M:%S"

, then you can leave the format string out of the plot command:

  plot $dat us (timecolumn(1)):2

"set xdata time" automatically sets the x output format to the one set
by "set timefmt", unless you have defined it otherwise via "set format x".

With "xdata time" set, you can finally simply write

  plot $dat 1:2

. (Or so I thought. Doesn't work now. Hm.)

 Hope that helps.

  Karl




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


#3542

Fromvittec@gmail.com
Date2017-01-19 23:52 -0800
Message-ID<1697fe89-48dc-4ff2-b6d1-ae551fe6cf12@googlegroups.com>
In reply to#3541
Ok. Sorry forma the lack of information.
Im actually using 4.6.6 im runing it un a raspberry pi with raspbian and it came preinstalled. I will try again and c&p the script and results.
Thanks for tour help

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


#3544

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-01-20 11:17 +0100
Message-ID<o5so30$crg$1@solani.org>
In reply to#3542
Am 20.01.2017 um 08:52 schrieb vittec@gmail.com:
> Ok. Sorry forma the lack of information.
> Im actually using 4.6.6 im runing it un a raspberry pi with raspbian and it came preinstalled. I will try again and c&p the script and results.
> Thanks for tour help

You're welcome.

btw. raspbian sounds like it's something to do with debian. You can
try if it has a package gnuplot5 if you want.

P.S. "set xdata time" does not actually change the output format to
the one set by "set timefmt", but to some default "% h" instead.

[toc] | [prev] | [standalone]


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


csiph-web