Contour Levels
conLev_1.ncl:
Demonstrates how to set the contour levels manually.
cnLevelSelectionMode is set to ManualLevels (default is AutomaticLevels), which allows the user to set the minimum contour level (by using cnMinLevelValF), the maximum contour level (via cnMaxLevelValF), and the contour interval (with cnLevelSpacingF).
conLev_2.ncl:
Sets the contours based solely on a user-defined number of contour levels.
When cnLevelSelectionMode is set to EqualSpacedLevels (default is AutomaticLevels), cnMaxLevelCount can be used to set the number of contour levels. If the data array x is to be plotted, the contour interval is set by the following equation:
(max(x)-min(x))/cnMaxLevelCount = CI
The minimum contour level is then set to min(x)+CI, and the maximum contour level is set to max(x)-CI.
conLev_3.ncl:
Demonstrates how to set the contour levels explicitly.
cnLevelSelectionMode is set to ExplicitLevels (default is AutomaticLevels), which allows the user to set the contour levels by using cnLevels.
cnFillColors is also set here to explicitly set the colors to be used for the color shading.
conLev_4.ncl:
Demonstrates how to create contours of a constant field. This
example only works if your data array also contains missing
values. The where function is used set these
missing values to some constant value (that is not equal to the
constant value you already have). This gives NCL two values to
contour.
The first frame creates a 2-box labelbar. The second frame creates a 1-box labelbar, by coloring the 2-box labelbar in the same color.
In a future release of NCL, we plan to add a special contour resource that handles constant fields more easily.