gnuplot热图与SVG
我正在尝试使用SVG端子使用GNUPLOT(5.2.8)绘制热图。 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
I am trying to plot a heatmap using gnuplot (5.2.8) with the SVG terminal.
Gnuplot interpolates the colors between the center points of the cells.
When I use the pdf terminal the result is as expected and the cells are clear and uniform faces.
How do I turn the interpolation for the SVG terminal off?
#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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
进行插值不是GNUPLOT,而是SVG查看程序。撇开您如何说服观众不执行此操作的问题,您可以通过在gnuplot命令中使用关键字
pixels
来防止发生这种情况:这告诉程序在输出中描述每个像素图像作为单独的矩形而不是将它们合并到连续像素的流中。另请参阅:
heatmaps demo
It is not gnuplot that does the interpolation - it is the SVG viewing program. Leaving aside the question of how you might persuade the viewer not to do this, you can prevent it from happening by using the keyword
pixels
in the gnuplot command:This tells the program to describe each pixel in the output image as a separate rectangle rather than merging them into a stream of contiguous pixels. See also:
heatmaps demo