data = cgDemoData(2)
ncolors = 10
levels = Indgen(10)* 175
cgLoadCT, 22, /Brewer, /Reverse, NColors=ncolors, Bottom=1
cgContour, cgDemoData(2), C_Colors=BIndgen(ncolors)+1, /Fill, Level=levels, /Outline, Position=[0.1, 0.1, 0.9, 0.8]
cgColorBar, NColors=ncolors, Bottom=1, Range=[0,ncolors*175], /Discrete
You can learn more about this here:
http://www.idlcoyote.com/...s_tips/cgcontour.php
You can download a picture of the output here:
http://www.idlcoyote.com/misc/contour_example.png