gnuplot:数据矩阵的2D图

Jac*_*ack 7 gnuplot

如何在具有这种数据结构的Gnuplot中绘制(2D绘图)矩阵,使用第一行和列作为ax和y ticks(第一行的第一个数字是列数)并表示其余值通过颜色映射,可以在2D平面上看到它?

4 0.5 0.6 0.7 0.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
Run Code Online (Sandbox Code Playgroud)

Chr*_*oph 8

您可以使用绘制此数据格式matrix nonuniform.

要获得热图,您可以绘制with image(常规网格,无插值,每个数据点的一个四边形)或绘图with pm3d(也支持不规则网格和插值,绘制四个相邻数据点的一个四边形).

  1. with image

    set autoscale xfix
    set autoscale yfix
    set autoscale cbfix
    plot 'data.dat' matrix nonuniform with image notitle
    
    Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

  1. pm3d

    set autoscale xfix
    set autoscale yfix
    set autoscale cbfix
    set pm3d map
    splot 'data.dat' matrix nonuniform notitle
    
    Run Code Online (Sandbox Code Playgroud)

在此输入图像描述