Assuming I have a file that looks like this:
"p = 0.1"
1 1
3 3
4 1
"p = 0.2"
1 3
2 2
5 2
Is it possible to make Gnuplot plot these two datasets in one plot with the titles given on the first line of each dataset?
gnuplot
Assuming I have a file that looks like this:
"p = 0.1"
1 1
3 3
4 1
"p = 0.2"
1 3
2 2
5 2
Is it possible to make Gnuplot plot these two datasets in one plot with the titles given on the first line of each dataset?
Best Answer
It's definitely possible and your datafile is already the correct format. The functionality you're looking for is built into
columnheader(N)
which reads the data at the top of the N'th column and uses it as the plot title:which can be condensed using iteration: