title: pm3d in gnuplot with binary data
body: <p>I have some data files with content</p>
  
  <pre><code>a1 b1 c1 d1
  a1 b2 c2 d2
  ...
  [blank line]
  a2 b1 c1 d1
  a2 b2 c2 d2
  ...
  </code></pre>
  
  <p>I plot this with gnuplot using </p>
  
  <pre><code>splot 'file' u 1:2:3:4 w pm3d.
  </code></pre>
  
  <p>Now, I want to use a binary file. I created the file with Fortran using unformatted stream-access (direct or sequential access did not work directly). By using gnuplot with</p>
  
  <pre><code>splot 'file' binary format='%float%float%float%float' u 1:2:3
  </code></pre>
  
  <p>I get a normal 3D-plot. However, the pm3d-command does not work as I don't have the blank lines in the binary file. I get the error message:</p>
  
  <pre><code>&gt;splot 'file' binary format='%float%float%float%float' u 1:2:3:4 w pm3d
  Warning: Single isoline (scan) is not enough for a pm3d plot.
  Hint: Missing blank lines in the data file? See 'help pm3d' and FAQ.
  </code></pre>
  
  <p>According to the demo script in <a href="http://gnuplot.sourceforge.net/demo/image2.html" rel="nofollow">http://gnuplot.sourceforge.net/demo/image2.html</a>, I have to specify the record length (which I still don't understand right). However, using this script from the demo page and the command with pm3d obtains the same error message:</p>
  
  <pre><code>splot 'scatter2.bin' binary record=30:30:29:26 u 1:2:3  w pm3d
  </code></pre>
  
  <p>So how is it possible to plot this four dimensional data from a binary file correctly?</p>
  
  <p>Edit: Thanks, mgilson. Now it works fine. Just for the record: My fortran code-snippet:</p>
  
  <pre><code> open(unit=83,file=fname,action='write',status='replace',access='stream',form='unformatted')
   a= 0.d0
   b= 0.d0
   do i=1,200
      do j=1,100  
         write(83)real(a),real(b),c(i,j),d(i,j)
         b = b + db
      end do
      a = a + da
      b = 0.d0
   end do
  close(83)
  </code></pre>
  
  <p>The gnuplot commands:</p>
  
  <pre><code> set pm3d map
   set contour
   set cntrparam levels 20
   set cntrparam bspline
   unset clabel
  splot 'fname' binary record=(100,-1) format='%float' u 1:2:3:4 t 'd as pm3d-projection, c as contour'
  </code></pre>