8

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

1 Answer 1

4

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?

Sign up to request clarification or add additional context in comments.

5 Comments

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.
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 3 Now I'd like to plot more of such plots like the "fence plot" in the examples.. But that's a different story.
Sorry for bringing up this really old thread. I have data that looks exactly like the one posted (even same number of lines & columns). When I try your answer, I only get Formatted input can only handle 7 data columns. What did I do wrong?
Indeed. The splot parameters that I used that time, no longer works for Gnuplot 5.0. I quickly checked 4.4, and the command posted here works OK. I suppose this could be a bug in 5.0. I raised a ticket: sourceforge.net/p/gnuplot/bugs/1675
@JuliusNaeumann The bug has been fixed, but I am not sure how it will take until next Gnuplot release: github.com/gnuplot/gnuplot/commit/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.