tags:

views:

352

answers:

1

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  A: 

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?

osti
Thanks for the quick reply. But if you look at the Y scale - it's not showing the correct values (which should be 5,6,7,8). X scale is OK 1,2,3,4. The Z scale shows values from the row that starts with "2". Btw. I am using Gnuplot 4.4.
Jakub Czaplicki
This pretty much do what I sort of need: splot 'data.csv' using 0:0:2 '%lf,%lf,%lf,%lf,%lf' with linespoints pt 6 ps 2 lw 3Now I'd like to plot more of such plots like the "fence plot" in the examples.. But that's a different story.
Jakub Czaplicki