I'm trying to plot data obtained with FreeFEM++ using gnuplot.
From FreeFEM I have saved the data with the following code:
{ ofstream ff("sol.dat");
for (int i=0;i<Th.nt;i++){
for ( int j=0; j<3; j++){
ff<<Th[i][j].x << "\t" << Th[i][j].y << "\t" << u[][Vh(i,j)] << endl;
}
ff<<Th[i][0].x << "\t" << Th[i][0].y << "\t" << u[][Vh(i,0)] << "\n\n\n";
}
}
A sample of the first lines of data is:
0.635787 -0.0440338 0.0056924
0.65234 -0.063181 0.00797757
0.655369 -0.0412323 0.00795786
0.635787 -0.0440338 0.0056924
0.597634 -0.0376 3.06323e-33
0.613904 -0.0585366 0.0030425
0.616879 -0.0388107 0.0030295
0.597634 -0.0376 3.06323e-33
where for some reason which I don't know there is a data point repeated two times in each 'pack'. But this is how they tell you to do it in the FreeFem manual. Apparently GNUPLOT needs the spaces between 'packs of data' for some reason.
I'm trying to plot the data with the gnuplot script:
set pm3d at b
set palette rgbformulae 30,31,32
set hidden3d
splot "sol.dat" with lines palette
It plots fine but I think pm3d is not doing anything. I thought pm3d would include the colored pattern of heat intensity in the bottom of the plot. Also I don't find the way to fill with solid color the gaps between the lines in the plot.
Thank you.
set pm3d at b
. You need to add one point twice, becausepm3d
uses four points to create one rectangle with one color. A4x4
matrix would result in3x3
colored rectangles. Could you explain in words, how your plot should look like (how are the lines to be displayed?, how the surface?, pm3d only on the base? what should be hidden etc). As you have it, the options don't fit together. – Christoph