从 gnuplot 中的矩阵旋转热图

Rotating a heat map from a matrix in gnuplot

我正在尝试将来自矩阵的热图旋转 45º。旋转离散数据时的问题是绘图超出了 window 的大小,到达标签和抽动位置。解决问题的任何想法或替代方法? 主要代码

set xrange[-20:20]
set yrange[30:50]
plot "test.txt" u (-+1):(+):3 matrix with image notitle

还有我 obtain. The data file http://www.filedropper.com/test_146

我建议使用 splotpm3d 的替代方案,因为 set pm3d 有选项 clip1inclip4in 告诉 gnulpot 要绘制哪个四边形,但可用:

set pm3d map clip4in corners2col c1
set yrange[10:*]
splot 'test.txt' u (-+1):(+):3 matrix with pm3d notitle

它会显示一些虚假的三角形:

如果您想进行插值,请查看 this question

请注意 splot [...] with pm3d 会绘制四边形的颜色,因此如果您的矩阵为 NxM,您将得到 (N-1)x(M-1)。另一方面,使用 plot [...] with image 你会得到 NxM quandrangles。 (参见 help image)。