我正在尝试使用gnuplot(5.2.8)与SVG终端绘制热图。Gnuplot在单元格的中心点之间插入颜色。
当我使用pdf终端时,结果如预期的那样,单元格是清晰和统一的面。我如何关闭SVG终端的插值?
#set terminal svg size 600,600
set terminal pdf size 600,600
set style line 12 lc rgb '#ffffff' lt 1 lw 5
set border front 15 ls 12
set grid front ls 12
set datafile separator ','
percent_sample(sample) = sprintf("sample_%d/configuration.csv", sample)
set palette defined (0 '#c00000', 1 '#0000cc') model RGB
unset colorbox
#set cbrange[0:1]
set xrange [-0.5:9.5]
set yrange [-0.5:9.5]
unset key
set tics scale 0
unset xlabel
set xtics 0.5,1
unset ylabel
set ytics 0.5,1
set tmargin 0
set bmargin 0
set lmargin 0
set rmargin 0
#set view map
set output sprintf("sample_conf_%d.pdf", i)
plot percent_sample(i) matrix with image
这不是gnuplot做插值-它是SVG查看程序。先不考虑如何说服查看器不要这样做的问题,您可以通过在gnuplot命令中使用关键字pixels
来防止这种情况发生:
plot percent_sample(i) matrix with image pixels
这告诉程序将输出图像中的每个像素描述为一个单独的矩形,而不是将它们合并到一个连续像素流中。参见:
的热图演示