1

I have a data file, (.tab with 11 columns and ~30000 lines ) and when I go on gnuplot, I write :

set pm3d map
splot "merged.tab" u x:y:z

and says:

Warning: Single isoline (scan) is not enough for a pm3d plot.
Hint: Missing blank lines in the data file? See 'help pm3d' and FAQ.

on other files, it works, but I don't know why it doesn't work on this one.

Do I have to edit the files to get the columns I want? But I cant really do that through .tab files?

Any help is appreciated.

2
  • What exactly do you mean by a ".tab" file? are you referring to a file in the MapInfo TAB format, or just a tab-delimited text file? What "other files" have you tried that work (other .tab files, or other files in general)? Apr 6 '17 at 0:02
  • Yeah, MapInfo tab format, excactly, and have tried other .tab files, that worked. Dunno why this won't work :( @steeldriver Apr 6 '17 at 6:09
3

Your datafile must have the appropriate grid format (xyz or matrix -> these two links should clarify [1], [2]). Following the xyz format your x column must be arranged in a way that there is a blank line between every change in x-value.

For example a xyz grid format is:

# X   Y    Z
  0   0    0
  0   1    1
  0   2    4
  0   3    9
  0   4   16
  0   5   25

  1   0    1
  1   1    2
  1   2    5
  1   3   10
  1   4   17
  1   5   26
  ... ... ...

The reason for this grid format is that you aim to plot a 2D projection of contour-isolines since you use pm3d map.

However, notice that if your datafile contains data e.g. as a result of a function, this doesn't mean necessarily that they have a grid format and you have to find a programming way in order to give them this format. Maybe this TAB format, that i am unaware of, has data in "grid" format and needs just the sorting of x column and the addition of blank lines.

0

copy paste answer from http://www.gnuplot.info/faq/faq.html#x1-320003.9

3.9 Pm3d splot from a datafile does not draw anything

You do set pm3d; splot ’a.dat’ and no plot but colorbox appears. Perhaps there is no blank line in between two subsequent scans (isolines) in the data file? Add blank lines! If you are curious what this means, then don’t hesitate to look to files like demo/glass.dat or demo/triangle.dat in the gnuplot demo directory.

You can find useful the following awk script (call it e.g. addblanks.awk) which adds blank lines to a data file whenever number in the first column changes:

/^[[:blank:]]*#/ {next} # ignore comments (lines starting with #)  
NF < 3 {next} # ignore lines which don’t have at least 3 columns  
$1 != prev {printf ~\n~; prev=$1} # print blank line  
{print} # print the line

Then, either preprocess your data file by command awk -f addblanks.awk or plot the datafile under a unixish platform by gnuplot> splot ~

However my version of awk does not understand that code. Instead I had to replace the third line by

$1 != prev {printf "\n"; prev=$1} # print blank line  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.