Cheat Logo

Cheat Sheet

Three-dimensional data

Level: Intermediate
  • OS X
  • Linux
  • BSD
  • Solaris
  • Gnuplot

When graphing 3d data, it is often clearer to use a color map than to plot a surface in three dimensions. Use a clear color scale with an obvious mapping. This will make it easier to read. See 3-Dim Plot with a Color-Map (pm3d) for examples.

To plot something like this:

you can use these commands:

set terminal png size 600,600 crop # output a 600x600 pixel png image
set pm3d map # use 3d color map plot
set xrange [1:321] # manually set range of x-axis
set yrange [1:321]
set size square # make the plot square
unset key # don't show key
set format x '' # don't show axis label
set format y ''
set cbrange [0:25] # the range of the z data
set output 'out.png' # the output file name
set title 'the title' # graph title
splot 'data.out' using 1:2:3 # plot the data file using the first three columns
©2015 Schutt Design (Luke & Noel Schutt).
Contact us using one of our first names at schuttdesign dot net.