gnuplot: 3D plot of a matrix of data

前端 未结 2 980
[愿得一人]
[愿得一人] 2020-12-06 18:18

How can I plot (a 3D plot) a matrix in Gnuplot having such data structure, using the first row and column as a x and y ticks (the first number of the first row is the number

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 19:14

    To plot a 4D plot, using colour as the 4th dimension, you can use

    splot  '1.txt' using 2:3:4:5  every ::1  palette
    #  |                              |
    #  |                              |
    # used for 3d plots            skip the header line
    

    Or do you want to draw a different picture, with x and y being the first column and line, and the numbers in the matrix just represinting z? Then use the following:

    splot '1.txt' every ::1:1 matrix
    

    To add some effects, you can change it to

    set dgrid3d 4,4
    splot '1.txt' every ::1:1 matrix with lines
    

提交回复
热议问题