I am plotting a surface using splot
; the data are defined on a regular grid with fairly small pixels. On screen it looks fine, but when I write it to a pdf there are white grid lines appearing around each pixel which look horrible (see image below). I have not found a way to turn them off, can anyone advise me please?
(Reduced) code to produce the image below:
reset
set multiplot layout 1,3 margins 0.05,0.9,0.05,0.95 spacing 0.09,0
set view map scale 1
unset surface
set colorbox
set pm3d
set palette
splot "Task9_2_final.dat" u 1:2:3 notitle
splot "Task9_2_final.dat" u 1:2:5 notitle
splot "Task9_2_final.dat" u 1:2:6 notitle
And to get the PDF I do:
gnuplot> set term pdf size 30cm, 10cm
Terminal type is now 'pdfcairo'
Options are ' transparent enhanced fontscale 0.5 size 30.00cm, 10.00cm '
gnuplot> set out "../figures/Task9_2.pdf"
gnuplot> load "Task9_2.gpl"
gnuplot> set term pop
(Where I've left the gnuplot output in, in case it is helpful).
This is an artifact introduced by poor antialiasing in many pdf viewers. If your gnuplot version is sufficiently recent, you can work around the viewer problem by retracing the border of each "pixel" in the grid. The command to do this is
set pm3d border retrace
I believe this command was first introduced in gnuplot 5.4 patchlevel 3. In earlier gnuplot versions the same thing could be achieved by an undocumented special linetype (behavior not guaranteed)
set pm3d border lt -6