Reputation: 35
I use the cairolatex terminal to generate plots with gnuplot for my latex documents. When I generate 3D plots with help of the command splot, the PDF generated by cairolatex exhibits fine structed grid lines which cause Moiré effects in the final document. This grid is not present when using the wxt terminal.
Here is my minimal example:
# set terminal wxt 1 size 700,700
set terminal cairolatex pdf size 7cm,7cm
set output 'test.tex'
set samples 100
set isosamples 100
set pm3d
set palette
f(x,y) = sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
splot f(x,y) with pm3d
This is the output: The arrow marks the fine lines I want to avoid.
The fine grid also occurs when using pngcairo. I already tried several cairolatex options I found on this website with no success, e.g. using linewidth 0. I further tried to suppress the grid with help of the command
set style fill noborder
without success.
Does anyone know how to get rid of the fine structured grid?
I run gnuplot 5 with patchlevel 1 (64-bit version) on a Windows 7 machine.
Upvotes: 0
Views: 2112
Reputation: 4095
Grid lines surrounding the pm3d rectangles are controlled by set pm3d border
. To turn them off, use set pm3d noborder
.
However, the lines you see are not generated by gnuplot, but instead are the background color that is sometimes visible at the "seam" between two neighboring polygons. You can see that, for example, by setting the terminal to set pdfcairo background rgb "green"
, and then the lines have the green background color. Whether not those seams are visible may depend on your pdf renderer.
There is not much you can do about having visible seams between polygons in a vector output format. One possibility is to fill the seam by an actual line drawn in the color of your choice. For example, using your code snippet but changing the plot command to
splot f(x,y) notitle with lines palette, f(x,y) with pm3d
gives this result (cairolatex terminal, pdf file rendered by Preview on OS X):
If I use the pngcairo
terminal I do not see the gaps between neighboring polygons:
Upvotes: 2