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
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.
with image
set autoscale xfix
set autoscale yfix
set autoscale cbfix
plot 'data.dat' matrix nonuniform with image notitle
pm3d
set autoscale xfix
set autoscale yfix
set autoscale cbfix
set pm3d map
splot 'data.dat' matrix nonuniform notitle