Discussion:
Provide a dense (lots of lines) X-Y plot with a string close to the graph to make it easier to understand to which category a line belongs
(too old to reply)
Franz Gotsis
2020-06-17 01:40:32 UTC
Permalink
I have a graph with about 40 lines (time series) which should visualize
which category behave similar and which ones are showing peculiar behavior.

code:
plot\
'/<path>/CurrentCellSelection-in-GNUplot-Format.txt' using 1:2 with
linespoi title 'cat 1',\
'/<path>/CurrentCellSelection-in-GNUplot-Format.txt' using 1:3 with
linespoi title 'cat 2',\
...
'/<path>/CurrentCellSelection-in-GNUplot-Format.txt' using 1:41 with
linespoi title 'cat 40',\
replot

At the moment I can either show a string at all points which renders the
graph way to crowded or none at all. Is there a way to specify that the
category should be printed for category 1 time series close to the value
for 1990 and for category 2 close to the value for 1991 and so on?

kind regards
Franz from Munich, Germany
Karl Ratzsch
2020-06-17 07:06:20 UTC
Permalink
Post by Franz Gotsis
I have a graph with about 40 lines (time series) which should visualize
which category behave similar and which ones are showing peculiar behavior.
plot\
'/<path>/CurrentCellSelection-in-GNUplot-Format.txt' using 1:2 with
linespoi title 'cat 1',\
'/<path>/CurrentCellSelection-in-GNUplot-Format.txt' using 1:3 with
linespoi title 'cat 2',\
At the moment I can either show a string at all points which renders the
graph way to crowded or none at all. Is there a way to specify that the
category should be printed for category 1 time series close to the value
for 1990 and for category 2 close to the value for 1991 and so on?
I donĀ“t really follow, but ...

By "string" you mean the legend for each plot line? The legend, or
"key" in gnuplot terminology, can only be in one place. You want a
label at the last datapoint of each line instead?

fname = '/path.....'
stats fname
np = STATS_records
plot for [i=1:41] fname us 1:(column(i+1)) w lp lc i notitle, \
for [i=1:41] fname ev ::np::np us 1:(column(i+1)):('cat'.i):(i) w
label lc variable notitle

Not tried now. You can always shift the label by adding some f(i) to
the positions, or choosing a different than the last record
depending on i.

Loading...