
create table points (p point);
insert into points select point(x,y) from generate_series(-5, 5) x, generate_series(-5, 5) y;

copy (select p[0] || ' ' ||  p[1]::text from points order by point_zorder(p)) to '/tmp/points.txt' ;

--\! gnuplot -p -e 'plot "/tmp/points.txt" using 1:2:(sprintf("%d", $0)) with labels notitle, "/tmp/points.txt" using 1:2 with lines'
\! gnuplot -p -e 'set title "Patch v15 (Heikki)" ;plot "/tmp/points.txt" using 1:2 with lines'
