How to generate contour maps

Convert the PGM (portable graymap) with pgmtoxyz.cc:

g++ pgmtoxyz.cc
./a.out <lisa.pgm >x

Then use gnuplot:

set nosurface
set contour
set view 0,0
splot 'x' w l

Manipulate the aspect ratio manually.

To generate a contour map with aspect ratio one:

set term table
set out 'lisacont.tbl'
replot
set out
set term x11
set size ratio -1    # stronger than "set size square"
set nokey
plot 'lisacont.tbl' w l

Output in tgif format:

set term tgif solid
set out 'lisacont.obj'
replot
set out
set term x11

Then edit to your taste.


Haruhiko Okumura

Last modified: 2004-05-26 16:43:13