How to improve lines quality of a heat map

a 夏天 提交于 2019-12-13 03:24:59

问题


I have plotted the matrix of numbers of this file

pher-of-1365.txt

with this code

set encoding iso_8859_1
set term postscript eps enhanced color size 4.7in,4in
set xlabel "longitude"
set ylabel "latitude"
set output "test0.eps"
set size square 
set title "Pheromones" font "Helvetica, 16"
set autoscale fix
set key
set yrange [:] reverse
set view map
splot 'pher-of-1365.txt' matrix with image

Which produces this plot:

The quality is not bad but the lines look blurred.

Is there a way to improve the clarity of the lines in the image?

Regards


回答1:


Use can try to use a different plot statement, and tweak the point size to get a sharper image. I used your script with the pdf terminal, in 4 different cases:

set terminal pdf size 12,12
set output "test0.pdf"
set encoding iso_8859_1

set xlabel "longitude"
set ylabel "latitude"
set size square
set format cb "%2.0t{/Symbol \327}10^{%L}"
set autoscale fix
unset key
set yrange [:] reverse
set view map

set multiplot layout 2,2

set title "plot with image"
splot 'pher-of-1365.txt' matrix with image

set title "plot with points pointtype 5 pointsize 0.45 palette"
splot 'pher-of-1365.txt' matrix with points pointtype 5 pointsize 0.45 palette

set title "plot with points pointtype 5 pointsize 0.25 palette"
splot 'pher-of-1365.txt' matrix with points pointtype 5 pointsize 0.25 palette

set title "plot with points pointtype 3 pointsize 1.25 palette"
splot 'pher-of-1365.txt' matrix with points pointtype 3 pointsize 1.25 palette

Resulting in:

Things to note:

  • The only reason the solution on the upper right panel works is because your plotting area is squared, and I used pointtype 5 (filled squares). Then, be tweaking the pointsize param you can fill the entire area. Note what happens on the bottom panels, when I change the size and type on the points.
  • As mentioned in the comments, the right way of doing this is using image, since it will figure things our by itself, and fill in the plotting area.


来源:https://stackoverflow.com/questions/49679757/how-to-improve-lines-quality-of-a-heat-map

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!