columns with time format as "y"

<[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <[email protected]>
Hello All,

I need help with the following problem:

Let's say my input data look like (columns delimited by \t):

   2019-04-16 20:30:00	30522	5
   2019-04-16 20:31:00	30523	6
   2019-04-16 20:32:00	30524	7
   2019-04-16 20:33:00	30525	8
   2019-04-16 20:34:00	30526	9
   2019-04-16 20:35:00	30527	10
   2019-04-16 20:36:00	30528	11
   2019-04-16 20:37:00	30529	12
   2019-04-16 20:38:00	30530	13
   2019-04-16 20:39:00	30531	14

Column 1 & 2 (space separated) considered as date/time.

Plotting Col. 3 or 4 against date/time works fine:

   set xdata time
   set timefmt "%Y-%m-%d\t%H:%M:%S"
   set format x "%d.%m. %H:%M"
   plot 'my_file.txt' using 1:3 title "col 3" axis x1y1 with linespoints
     pt7 lc 4, '' using 1:4 title "col 4" axis x1y1 with linespoints
     pt7 lc 7

Special feature: Although columns 1 and 2 *together* give the timestamp, 
only "1:..." is given for "using" statement. This method is often found 
in examples.

But now I would like - don't ask me why - to plot the timestamp against 
column 3, i.e. column 3 as "x" and the timestamp (columns 1 & 2) as "y".

I was trying:

   set ydata time
   set timefmt "%Y-%m-%d\t%H:%M:%S"
   set format y "%d.%m. %H:%M"
   plot 'my_file.txt' using 3:1 title "col 3" axis x1y1 with
     linespoints pt7 lc 4

Result: only date is used for plotting "y", time ignored!

Another trial:

   plot 'my_file.txt' using 3:($1+$2) title "col 3" axis x1y1 with
     linespoints pt7 lc 4

That didn't work either: this time the time was used for the plot as 
"y", but the date was set to 1.1. and the true date from column 1 was 
ignored.

What am I doing wrong? Unfortunately, you won't find an example of a 
timestamp consisting of two columns as a "y" value anywhere. Admittedly, 
this is rarely of use.

Thanks!

Best,
Thomas


_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.