I have a rather costly shell command which generates some output which is supposed to be plotted. The output contains information for several curves, e. g. like this:
echo 1 2 3; echo 4 5 6; echo 7 8 9
They are supposed to be plotted using a command like this:
plot <something> using 1:2, \
<something> using 1:3
To avoid calling the shell command repeatedly (as it is rather slow), I want to store its result in a datablock, but up to now my trials didn't work. Here is what I tried:
output = system("echo 1 2 3; echo 4 5 6; echo 7 8 9")
set print $DATA
print output
unset print
Now I seem to have a datablock containing what I want because print $DATA
now prints this:
1 2 3
4 5 6
7 8 9
The trailing blank line I hope isn't a problem but maybe it indicates that there is something wrong, I don't know.
When I now try to plot this with plot $DATA using 1:2
I only get the first of the three expected points (1|2), (4|5), and (7|8).
I feel there is probably an easier way to achieve my original goal but up to now I didn't find it.