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


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

Re: graph of complex data and timfmt settings

From Péter Juhász <peter.juhasz83@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: graph of complex data and timfmt settings
Date 2011-06-14 02:14 -0700
Organization http://groups.google.com
Message-ID <1e6d3cc2-ff33-41fc-b331-2959afb517cd@a7g2000vby.googlegroups.com> (permalink)
References <d3a4d558-79b0-4ec4-a285-cf86988e6480@w4g2000yqm.googlegroups.com>

Show all headers | View raw


On Jun 14, 7:44 am, Zio Peppe <zipe...@gmail.com> wrote:
> Dear gnuplot's guru
>
> I'm quite new with gnuplot, and my main trouble arises from a complex
> format of  data.
>
> I'd like to plot data coming daily from a set of digital sensors when
> they are stored on disk.
>
> This is the format of the log:  Data - time - level1 - level2
>
> where "level*" are the most relevant data:
>
> Wed Jun  1 03:00:01 2011 : level1 =  54 %, level2 = -3159.0
> Thu Jun  2 03:00:02 2011 : level1 =  53 %, level2 = -3159.0
> Fri Jun  3 03:00:03 2011 : level1 =  53 %, level2 = -3159.0
> Sat Jun  4 03:00:02 2011 : level1=  52 %, level2 = -3159.0
> Sun Jun  5 03:00:03 2011 : level1 =  51 %, level2 = -3159.0
> Mon Jun  6 03:00:03 2011 : level1 =  49 %, level2 = -3159.0
> Tue Jun  7 03:00:03 2011 : level1 =  48 %, level2 = -3165.0
> Wed Jun  8 03:00:02 2011 : level1 = 48 %, level2 = -3149.0
> Thu Jun  9 03:00:03 2011 : level1 = 47 %, level2 = -3174.0
> Fri Jun 10 03:00:01 2011 : level1 = 47 %, level2 = -3173.0
> Sat Jun 11 03:00:02 2011 : level1 = 45 %, level2 = -3173.0
>
> I have tried with the following set timefmt command, but it did not
> work:
>
> set timefmt "%a %b %d %T %Y"
>
> The ideal would be to have on X-axis the data (the time is not
> relevant) and both "levels" on Y-axis with their own scale.
>
> Each plot should graph one week or one month of data.
>
> Could you give to me some help?
>
> Many thanks
> ZPP

There are two different things to set when you want to plot time-
related data: one specifies how the data are read in from the file,
the other sets how they are displayed on the graph.

"set timefmt" sets the input format, however, "help time_spec" tells
you that the %T specifier only works on output, so you have to use %H:
%M:%S instead. Additionally, the day of the week is redundant, so I'd
recommend omitting it from the format specification.

By default, the data format for output includes time, which you don't
want, so you have to "set format x" too.

Putting it together:

set xdata time
set timefmt x "%b %d %H:%M:%S %Y"
set format x "%b %d"
set y2tics
set ytics nomirror
set ylabel "%"
plot "datafile" u 2:9 axes x1y1 title "level1", '' u 2:13 axes x1y2
title "level2"

Péter Juhász

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


Thread

graph of complex data and timfmt settings Zio Peppe <zipeppe@gmail.com> - 2011-06-13 22:44 -0700
  Re: graph of complex data and timfmt settings Péter Juhász <peter.juhasz83@gmail.com> - 2011-06-14 02:14 -0700

csiph-web