1

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:

enter image description here

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.

Community
  • 1
  • 1
Andrestand
  • 156
  • 1
  • 1
  • 16

2 Answers2

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'.

Christoph
  • 47,569
  • 8
  • 87
  • 187
  • Thanks, but that makes a white plot. Also the idea is making a command where you have no to specify if the tile is 5e-5 or... if I understand yours properly. – Andrestand Jul 31 '13 at 10:57
  • Do you get any warning? Could be, that your data is not formatted properly. For pm3d to work the data scans (i.e. the values for one y-value) must be separated by an empty line. An if you have this data format, you can use the `stats` command to determine the maximum and minimum y-value (`STATS_max_y` and `STATS_min_y`). And if you don't know the number of y-value but they are equally spaced, you can use `STATS_blank` to calculate the tile. – Christoph Jul 31 '13 at 11:38
  • I get that format warning. If there were some way of avoiding changing the format and using `stats`... it would be great. But thanks anyway! – Andrestand Jul 31 '13 at 12:26
  • You need the format to use `pm3d`, `stats` can't help you on that. I don't know of any other way to achieve what you want. – Christoph Jul 31 '13 at 17:57
0

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.

Community
  • 1
  • 1
Andrestand
  • 156
  • 1
  • 1
  • 16