Gnuplot is capable of 3D plot of straight lines. But then each segment is described
by two points with 3 coordinates each.
To break the plot of a polygonal line (i.e. insert a moveto) we need here too an empty
blank line, but it seems that some machine need 2. So we get the following example which
plots
:
void main()
{
Triangulation g("micro.msh");
ofstream f("fmicro.gnu");
float *u = new float[g.nv];
for(int i=0; i<g.nv; i++)
u[i] = g.v[i].x*g.v[i].x + g.v[i].y*g.v[i].y;
for(int i=0; i<nt; i++)
{
for(int i=0; i<3; i++)
f << g.v[t[i].v[i]].x <<"\t"<< g.v[t[i].v[i]].y <<"\t"
<< u[t[i].v[i]] << endl;
f << g.v[t[i].v[0]].x << "\t" << g.v[t[i].v[0]].y <<"\t"
<< u[t[i].v[0]] <<endl<<endl<<endl;
}
}
Then gnuplot must be launched as follows:
gnuplot set parametric splot "fmicro.gnu" w l