With
set colormap new PALETTE_TRANS # copy current palette into PALETTE_TRANS
do for [i=1:|PALETTE_TRANS|] { PALETTE_TRANS[i] = (PALETTE_TRANS[i] & 0xffffff) | 0x80000000 } # 0 is opaque
set view map
# set term 'pngcairo'
# set output 'try0.png'
splot '++' using 1:2:(0.0):(($1+$2)) with pm3d fillcolor palette PALETTE_TRANS
on Windows 7’ default terminal there appears a gray grid on the image. The grid appears also if I do “Export to PDF” from the Windows’ gnuplot graphic terminal (but at different positions). It does not appear with “Export to image” (to PNG), or if I uncomment the PNG output above.
confirmed on Qt terminal on gnuplot 6.0.1 on windows 11.
On wxt and windows terminal a gray grid does not appear.
The phenomena were observerd oncygwin and Ubuntu on Qt terminal.
They are specific to Qt terminal but not specific to Windows.
Last edit: Tatsuro MATSUOKA 2024-07-02
Is the try0.pdf file supposed to show this problem? I don't see anything in it that looks like a gray grid when viewed here in okular. Could this be a problem in the viewer rather than in the gnuplot output? That has been a recurring problem and a known bug in many pdf viewers. If so then you may be able to work around the problem by telling gnuplot
set pm3d border retrace
. That option was added specifically to deal with rendering programs that show imperfect alignment between adjacent rectangles in a tiled surface. PDF viewers are the prime offender, but you might be seeing a similar effect in your Qt rendering pipeline. The downside of the option is that just as the name says it retraces the border of each rectangle. That can have the undesired effect of making the borders less transparent if the same rendering glitch now causes them to overlap slightly rather than producing a spurious gap. That doesn't matter for a fully opaque surface.Thanks — but the problem is exacerbated a lot with either of your suggestions — in the same way. Initially, the gray lines are quite subtle.; with your modifications
try0.pdf
shows with very high contrast grid visible between rectangles.set pm3d border retrace
theqt
terminal on Win7 shows the same high contrast grid.BTW, I make transparent plots with
TiKZ
inpdflatex
all the time, and I do not recollect ever seeing such grid inSumatraPDF
. So at least technically, I suspect it is not an insurmountable goal to make this work in “less pedantic” PDF viewers.FWIW, turning off antialiasing solves the issue for the qt terminal (6.0.3 on Windows) (Note that this is not an issue with the wxt nor windows terminals here.)