gnuplot: 2D plot of a matrix of data

后端 未结 1 1265
旧巷少年郎
旧巷少年郎 2021-02-15 09:30

How can I plot (a 2D 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 of

1条回答
  •  星月不相逢
    2021-02-15 10:08

    You can plot this data format using matrix nonuniform.

    To get a heatmap you can plot either with image (regular grid, no interpolation, one quadrangle for each data point), or splot with pm3d (supports also irregular grids and interpolation, plots one quadrangle for four neighboring data points.

    1. with image

      set autoscale xfix
      set autoscale yfix
      set autoscale cbfix
      plot 'data.dat' matrix nonuniform with image notitle
      

    1. pm3d

      set autoscale xfix
      set autoscale yfix
      set autoscale cbfix
      set pm3d map
      splot 'data.dat' matrix nonuniform notitle
      

    0 讨论(0)
提交回复
热议问题