;---------------------------------------------------------------------- ; This script demonstrates three ways of drawing a contour plot: ; lines, color-filled, and pattern-filled. ; ; This graphic is used in the Graphics workshop lecture slides. ;---------------------------------------------------------------------- begin ;---Generate some dummy data. data = generate_2d_array(10, 12, -20., 17., 0, (/129,129/)) wks = gsn_open_wks ("png", "contour_fill_types") res = True res@gsnDraw = False ; Don't draw plots res@gsnFrame = False ; Don't advance frame res@cnLineThicknessF = 2.0 ; Thicken contour lines res@cnLineLabelsOn = False ; Turn off contour line labels res@tmXTOn = False ; Turn off right and top tickmarks res@tmYROn = False ; and labels ;---Line contours res@tiMainString = "Line contours" plot1 = gsn_csm_contour(wks,data,res) ;---Color-filled contours res@tiMainString = "Color-filled contours" res@cnFillOn = True ; Turn on contour fill res@cnLinesOn = False ; Turn off contour lines res@lbOrientation = "Vertical" plot2 = gsn_csm_contour(wks,data,res) ;---Pattern-filled contours res@tiMainString = "Pattern-filled contours" res@cnMonoFillPattern = False ; Use multiple fill patterns res@cnMonoFillColor = True ; Use single pattern color res@cnLinesOn = True ; Turn lines back on plot3 = gsn_csm_contour(wks,data,res) ;---Panel all three plots pres = True pres@gsnPanelXF = (/0.055,0.51,.055/) ; Adjust positions slightly pres@gsnMaximize = True pres@gsnPanelRowSpec = True pres@gsnPanelCenter = False gsn_panel(wks,(/plot1,plot3,plot2/),(/2,1/),pres) end