How is it possible with gnuplot to plot both isolated points and lines for the same input file?
I mean, once I have a file data.dat
of this kind that defines two lines 1-2 and 3-4
x1 y1
x2 y2
x3 y3
x4 y4
I can plot the lines with
$> plot 'data.dat' w lp
but if I want to also add some isolated points to be displayed with gnuplot I would like to add to my data.dat
file the following
x1 y1
x2 y2
x3 y3
x4 y4
x5 y5
x6 y6
x7 y7
obviously the points 5,6,7 are treated by gnuplot as points of a line. How can I draw 5,6,7 as isolated points?
Organize your data in blocks. There should be exactly one empty line between two blocks:
Use
every
to specify which blocks of the datafile should be plotted. The syntax of every is described here or in gnuplot (typehelp every
)In your case you can then do the following
if it's acceptable to plot point symbols for points 1..4, too, then just add empty lines after points 5 and 6 and say
if not, I'd suggest writing the isolated points to a separate file.