Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes


direct graphics

includes main-level program

Wrapper for CONTOUR that handles the NLEVELS keyword better: if LEVELS is not specified then NLEVELS contour levels are created equally spaced between the minimum and maximum values of z. The levels used can also be returned to the caller by passing a named variable to LEVELS.


Try the main-level example program at the end of this file:

IDL> .run mg_contour
This should produce something like:

After reading in the elevbin.dat dataset, the pertinent commands are:

IDL> mg_contour, data, /fill, nlevels=15, xstyle=1, ystyle=1, $ title='MG_CONTOUR' IDL> mg_contour, data, /overplot, nlevels=15, levels=levels, $ /follow, /downhill IDL> print, 'Levels used in MG_CONTOUR: ' $ + strjoin(strtrim(levels, 2), ', ')


top mg_contour

mg_contour, z [, x] [, y] [, nlevels=integer] [, levels=fltarr] [, _extra=keywords]

Produce a contour plot.


z in required type=fltarr(m, n)

2-dimensional array to be plotted

x in optional type=fltarr(m)

values for x-axis

y in optional type=fltarr(n)

values for y-axis


nlevels in optional type=integer default=6

number of contour levels

levels in out optional type=fltarr

values for isocline levels; specified values are used if present, set to a named variable to output the used levels if not

_extra in optional type=keywords

keywords to CONTOUR

File attributes

Modification date: Wed May 14 15:07:15 2014
Lines: 30
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.