Gnuplot can easily plot data from multiple files in the same plot.
plot "A.dat", "B.dat"
It can also combine values from different columns of a single input file.
plot "A.dat" using 1:($2+$3)
A frequently asked question is "how can I combine values from columns in multiple input files?". The answer is that you can't, you must instead process the data outside gnuplot so that all the needed values are in the same file.
The new "merge" command overcomes this long-standing limitation. It allows you to merge coordinate values from component graphs in the previous plot command into a single data block. Here is the documentation entry for this first draft of a patch implementing the merge command:
mergecommand extracts certain values from the preceding
Unresolved issues (please comment):
Currently the same x-values must appear in all of the merged plots.
It seems desirable to allow missing data points. How?
If the preceding plot contained both data and function graphs, the merge
command will probably complain about mis-matched x values. This is an
example of the above issue. Should it simply ignore functions?
Currently the merge command ignores xrange. Should it?
Is there a better name for the new command? I considered
"fill" "keep" "store" "extract" "combine" among other possibilities.
The interactive terminals now allow you to toggle individual graphs on/off.
Should a subsequent "merge" command only merge data from graphs that have
not been toggled off?
My own likely use of this option would require tracking error values associated
with each Y value. Since this first version of the patch only tracks a single
value per point, producing a merged data block containing both the Y values and
the error values is somewhat cumbersome. Should the basic command have an
option to merge 2 data values from each existing graph?
Log in to post a comment.