|
From: Dave H. <da...@ho...> - 2014-10-08 20:57:21
|
Continuing in my quest to push Gnuplot to its limits, I'd like to be able
to set the title of a graph to the dates of the first and last data. I'm
envisaging something like:
set title "Plot of Blah\nFrom $first to $last\n(Use at own risk)"
etc, where $first and $last are set from the first and last data lines.
I know that I can get this by reading the x-axis itself, but it's a bit
cleaner if it's part of the multi-line title.
Not knowing the innards of Gnuplot, I'm hoping that the title can be
printed dynamically in the first place, so a Small Matter Of
Programming(tm) should extract what I want, if possible.
Something like:
Grab first date => $first.
Keep reading until EOF.
Grab last date => $last.
sprintf("Plot of Blah\nFrom %s to %s", $first, $last) into title.
Plot.
(My next question will be whether it's possible to print the names of the
script and data files, when I print the graph date; I'm a data-driven sort
of guy.)
-- Dave
|