问题
I have a problem with gnuplot. I've searched and I don't find the correct solution. I'm plotting some data arranged in three columns with the command splot
, and the steps in x and y are different. The plot I get with:
set view map
splot 'data.dat' using 1:2:3 with points palette
is:
and I would like the white space to be filled, making each tile size adapt, avoiding interpolation.
Some ideas are given here Reduce distance between points in splot.
I've tryed http://gnuplot.sourceforge.net/demo/heatmaps.html too, but with image
doesn't seem to work :(
I should avoid pointsize
as my grid changes from time to time.
回答1:
You can try
set pm3d map interpolate 1,1 corners2color c1
splot 'data.dat' using 1:($2-5e-5):3
This uses no interpolation, and the color of each polygon depends on the value of corner 'c1'. You may need to test if this is the correct one, or if you need 'c2', 'c3', or 'c4'.
回答2:
Another solution to my problem, better than this one for some terminals at least, is given in the answers to my other question about maps appearance in pdfcairo terminal, where the solution comes when using plot with image
insted of this splot
. I tried to use that before, as I mention here, but maybe it also needed this specific data format.
来源:https://stackoverflow.com/questions/17967664/gnuplot-filling-the-whole-space-when-plotting-sampled-data