|
From: Reginald B. <pul...@ya...> - 2026-02-10 14:37:09
|
Norwid,
Thank you for a such a detailed answer. It's not my data. I'm trying to help someone else and got in over my head.
I will buy the book as I am a long time gnuplot fan.
Have Fun!Reg
On Monday, February 9, 2026 at 04:14:24 PM CST, Norwid Behrnd <nb...@ya...> wrote:
Dear Reginald
There are two issues with the data shared by you. 1) There are 16 min between
the first, and the second measurement; subsequently, the interval is 1 min
only. Either clip the data (and explain why you did), or recollect the data
equidistant in time.
2) Dependent values of column 6 are _much_ away from the values of column 4,
5, and somewhat 7; and again a column 8 and 9. Either break the ordinate, use
a secondary ordinate, or use multiple sub figures to illustrate your findings.
By recollection, the second edition of "Gnuplot in Action" includes inspiring
colorful examples including the corresponding source code.
But since your question is about to get the proverbial foot into the door, I
clipped the raw data to have a file `data.dat`
```data.dat
2 2026/02/05 20:57 26.8 38.02 983.32 13.54 0.21 2.76
3 2026/02/05 20:58 26.81 38.01 983.29 13.55 0.07 2.75
4 2026/02/05 20:59 26.81 38.0 983.28 13.55 0.19 2.75
5 2026/02/05 21:00 26.81 37.98 983.33 13.55 0.21 2.8
6 2026/02/05 21:01 26.81 37.99 983.34 13.55 0.21 2.81
```
with the 9 columns per line separated by one explicit white space. With focus
on column 8 and 9, my MRE `proximo.gp` is
```proximo.gp
set terminal png
set title "test"
set output "test.png"
set datafile separator whitespace
set xdata time
set timefmt "%Y/%m/%d %H:%M"
set format x "" # let xticlabels define what is printed
set xtics out nomirror
set format y "%.2f"
set ylabel "values"
# helper: build a two-line label "YYYY/MM/DD\nHH:MM"
lab(i) = sprintf("%s\n%s", strcol(2), strcol(3))
plot "data_02.dat" using (timecolumn(2, "%Y/%m/%d") + \
timecolumn(3, " %H:%M")):8:xticlabels(lab($0)) \
with lines title "col8", \
"" using (timecolumn(2, "%Y/%m/%d") + \
timecolumn(3, " %H:%M")):9 with lines title "col9"
```
to yield the illustration (`test.png`) attached by the call of
```bash
$ gnuplot proximo.gp
```
with gnuplot version gnuplot 6.0 patchlevel 3 as currently packaged for Linux
Debian 14/forky (branch testing). I added a couple of backslashes to break
lines otherwise the email editor would break visually (and in consequence, in
function). One can do better (e.g., increase of the canvas dimension -- I
forgot how -- to prevent the time marks so close to the border), though.
Regards,
Norwid
https://www.manning.com/books/gnuplot-in-action-second-edition
|