问题描述:

I'm having problems in plotting with pdfcairo what I was making with wxt terminal in gnuplot.

The code I use for wxt is:

set term wxt 0 size 1000,562

set pm3d map

set size 0.9

splot 'XYZpm3d.dat'

and this gives something like:

while in pdfcairo I write:

set term pdf color size 25cm,14cm

set out 'plot.pdf'

set pm3d map

set size 0.9

splot 'XYZpm3d.dat' palette

set out

And I get something like:

How can I fix the colour saturation problem? It doesn't affect the colorbar or the text, and it also does not happen if the splot is splot (x*x+y)/100 instead of that of the data file. It also seems the problem arises when using map.

网友答案:

This is not a saturation effect, but an antialiasing problem of the many tiny rectangles which splot draws, see the beginning of my answer to problematic Moire pattern in image produced with gnuplot pm3d and pdf output.

The best way to overcome this problem is to plot with image, which plots your data as bitmap, which is what you actually also have. This however requires equally spaced values in x and y:

set term pdf color size 25cm,14cm
set out 'plot.pdf'
set size 0.9
set autoscale fix
plot 'XYZpm3d.dat' with image
set out

It you don't have equally spaced values it becomes quite involved to get a proper image, see problematic Moire pattern in image produced with gnuplot pm3d and pdf output or Big data surface plots: Call gnuplot from tikz to generate bitmap and include automatically? on TeX.SX.

相关阅读:
Top