6
votes

How can I plot (a 3D plot) a matrix in Gnuplot having such data structure. I cannot find a way to use the first row and column as a x and y ticks (or to ignore them)

,5,6,7,8
1,-6.20,-6.35,-6.59,-6.02
2,-6.39,-6.52,-6.31,-6.00
3,-6.36,-6.48,-6.15,-5.90
4,-5.79,-5.91,-5.87,-5.46

Is the splot 'data.csv' matrix the correct parameter to use ?

1
The docs appear to document using the first row/column as coordinates only for the binary format: gnuplot.info/docs_4.2/node330.html what a shame. Related examples at: gnuplot.info/demo_5.3/image2.html I'll just stick to explicit coordinates x0 y0 z00 \n x0 y1 z01 for now.Ciro Santilli 新疆再教育营六四事件法轮功郝海东

1 Answers

4
votes

You can give using a format specification; here we need to tell the seperator ','. The following works for me:

splot 'data.csv' using 1:2:3 '%lf,%lf,%lf,%lf' with linespoints pt 6 ps 2 lw 3

except that the first line is ignored, which is probably right?