matrix - 用线绘制矩阵 gnuplot

标签 matrix gnuplot

我正在制作图表,但我想使用线条而不是点。

使用线条样式,所有点都连接起来,并且图形具有网络外观,这是我不想要的。

set grid 
set ticslevel 0.1 
set samples 51, 51 
set isosamples 20, 20 
set border 1+2+4+8
unset key
splot 'matrix.dat' matrix

部分数据绘制矩阵图

0.261   0.665   0.225   0.382   0.255   0.574   0.356
0.338   0.845   0.0363  0.167   0.727   0.0805  0.764
0.225   0.196   0.107   0.153   0.347   0.338   0.168
0.157   0.443   0.0671  0.135   0.312   0.408   0.362
0.151   0.281   0.0572  0.103   0.309   0.49    0.242
0.12    0.336   0.0604  0.173   0.19    0.395   0.153
0.119   0.173   0.0336  0.145   0.156   0.219   0.177
0.123   0.0452  0.0165  0.149   0.0932  0.0663  0.133
0.123   0.0741  0.00373 0.136   0.0346  0.485   0.131
0.111   0.241   0.0124  0.105   0.0127  1.01    0.122
0.096   0.475   0.0194  0.0569  0.0284  1.67    0.102
0.0777  0.773   0.0175  0.00929 0.0375  2.42    0.0831
0.059   1.11    0.0123  0.0322  0.0408  3.23    0.0635
0.0438  1.48    6.44E-4 0.0659  0.0265  4.07    0.0445
0.0349  1.92    0.0192  0.078   0.00585 4.92    0.0254
0.0392  2.42    0.0446  0.0632  0.0306  5.73    0.00774
0.0518  2.97    0.0745  0.031   0.0729  6.46    0.00716

Model Graphics

最佳答案

这不能自动完成。您必须确定矩阵的行和列。首先,要获取行数,请使用

stats 'matrix.dat' using 1 nooutput
rows = STATS_records

对于列数,请使用 then

stats 'matrix.dat' matrix nooutput
cols = STATS_records/rows

现在绘制每一行

unset key
splot for [i=0:cols-1] 'matrix.dat' matrix every ::i::i lt 1 with lines

结果(4.6.4)是:

enter image description here

关于matrix - 用线绘制矩阵 gnuplot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23747010/

相关文章:

gnuplot - 如何在顶部显示中线

gnuplot - gnuplot-仅在图例/键中增加点的大小

linux - GNUplot 中的多图

matrix - 设置vim背景透明

python - np.loadtxt 用于包含多个矩阵的文件

math - 乘法矩阵

matlab - 使用 matlab 从给定的二进制矩阵创建邻域图

graph - 使用Gnuplot的3D映射图不准确

gnuplot 等高线图阴影线

java - 我的 3x3 矩阵程序的逆部分?