I have some data, which I would like to plot in 3d and 2d Graphs. I do have a data file which has the following shape:
1 1 2
2 1 4
3 1 6
4 1 8
1 2 1
2 2 2
3 2 3
4 2 4
1 3 4
2 3 3
3 3 2
4 3 1
1 4 8
2 4 6
3 4 4
4 4 2
In this case the first column is x, the second one is y and the third one is the value. Actually I am using a file, which has 100 individual matrices, but I think that this example should be a little bit handier. :)
I made a 3d plot by using: splot "data.txt" using 1:2:3 with lines
In addition I would now like to make 2D plots in both directions. So something like
plot "data.txt" using 1:3
using only the first matrix
and
plot "data.txt" using only the first line of 2:3 in every matrix
I found help at 1 in the section "How do I plot a part of data in a file?"
For the first case
plot "data.txt" every :::1:1 using 1:3 with lines
does seem to do the job
But for the second case I am not sure, how to manage the syntax the right way
plot "data.txt" every ::1 using 1:3 with lines
would not do what I expected. The plot is actually either empty or contains only one single data file.
plot "data.txt" every :::0::0 using 1:3 with lines, note the zeros (which in gnuplot is the first element rather than 1) and the extra colon ":" in between zeros. This means "start plotting block zero and end with block zero". - Miguel