<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#
# Panel exercise 6.
#
import Ngl

#
# Generate some dummy data.
#
data1 = Ngl.generate_2d_array([40,40], 10, 12, -20., 17.,0)
data2 = Ngl.generate_2d_array([40,40], 13, 13, -25., 15.,1)
data3 = Ngl.generate_2d_array([40,40], 10, 10, -22., 16.,2)
data4 = Ngl.generate_2d_array([40,40],  9, 10, -23., 15.,3)

wks = Ngl.open_wks("x11","panel_ex06")      # Open an X11 window
Ngl.define_colormap(wks,"testcmap")         # Change colormap

# Set up resources.
res                     = Ngl.Resources()
res.nglDraw             = False       # Turn off draw
res.nglFrame            = False       # Turn off frame advance
res.cnFillOn            = True        # Turn on contour fill
res.cnLinesOn           = False       # Turn off contour lines
res.cnLineLabelsOn      = False       # Turn off contour line labels
res.lbLabelBarOn        = False       # Turn off labelbar

# Set contour levels using an array of values.
res.cnLevelSelectionMode = "ExplicitLevels"
res.cnLevels             = [-24,-20,-18,-15,-11,-7,-3,-1,2,5,7,10,13,16]

# Create arrays to hold four plots.
plot = []
plot.append(Ngl.contour(wks,data1,res))
plot.append(Ngl.contour(wks,data2,res))
plot.append(Ngl.contour(wks,data3,res))
plot.append(Ngl.contour(wks,data4,res))

pres = Ngl.Resources()
pres.nglPanelLabelBar = True

Ngl.panel(wks,plot,[2,2],pres)

Ngl.end()

</pre></body></html>