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


Groups > comp.graphics.apps.gnuplot > #3541

Re: Lost minutes

From Karl Ratzsch <mail.kfr@gmx.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Lost minutes
Date 2017-01-19 20:53 +0100
Organization solani.org
Message-ID <o5r5f9$q25$1@solani.org> (permalink)
References <566df517-180f-4457-8a64-a899cf76e57f@googlegroups.com>

Show all headers | View raw


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




Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

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

csiph-web