Duplicate contour line labels with overlay shading

From: Arlene Laing <laing_at_nyahnyahspammersnyahnyah>
Date: Wed, 02 Sep 2009 10:47:42 -0600

Good day,

I am getting duplicate contour line labels after overlaying a
stippling pattern for contours above a certain value of equivalent
potential temperature (eth).

As you can see from the excerpted script below, I reset the resource
(res_eth) contour line and contour line label to "False" before
calling "gsn_contour_shade". However, that does not stop the
duplication.

Your help with solving this problem will be greatly appreciated.

Thanks.
Arlene Laing
NCAR/MMM

;***********************************************
; set plot resources
   res_at_vpWidthF = .9 ; overwrite basic plot size
   res_at_vpHeightF = 1.0
   pltres = True

         res_xy = res
         res_xy_at_tiYAxisString = "Pressure (hPa)"
         res_xy_at_AspectRatio = 0.75
         res_xy_at_cnMissingValPerimOn = True
         res_xy_at_cnMissingValFillColor = 0
         res_xy_at_cnMissingValFillPattern = 11
         res_xy_at_sfYCStartV = max(pressure_levels)
         res_xy_at_sfYCEndV = min(pressure_levels)
         res_xy_at_trYReverse = True ; reverse Y axis
         res_xy_at_trYLog = True ; Log scale
         res_xy_at_tmYLMode = "Explicit"
         res_xy_at_tmYLValues = (/1000., 850., 700., 600., 500., 400., \
                               300., 250., 200./)
         res_xy_at_tmYLLabels = (/"1000","850","700","600","500","400", \
                               "300","250","200"/)
; res_xy_at_sfYArray = pressure_levels
         res_xy_at_tiXAxisFontHeightF = 0.02
         res_xy_at_tiYAxisFontHeightF = 0.02
         res_xy_at_tmXBMajorLengthF = 0.02
         res_xy_at_tmYLMajorLengthF = 0.02
         res_xy_at_tmYLLabelFontHeightF = 0.015
         res_xytxFontHeightF = 0.015
         res_xy_at_tiXAxisString = "Latitude"
         res_xy_at_sfXArray = lat2d(:,0)

         res_xy_at_gsnDraw = False ; Don't draw plots
         res_xy_at_gsnFrame = False ; Don't advance frame

        ; Plotting options for U
         res_u = res_xy
; res_u_at_cnInfoLabelOrthogonalPosF = 0.00
         res_u_at_cnInfoLabelOn = False ; turn off cn info label
         res_u_at_cnLineLabelPerimOn = False ; turn off label perimeter
         res_u_at_cnLabelMasking = True ; do not draw labels over contour
         res_u_at_cnLineLabelFontHeightF = 0.016
         res_u_at_cnLineLabelBackgroundColor = "white"
         res_u_at_cnLineThicknessF = 1.5
         res_u_at_ContourParameters = (/ -30., 20, 2. /)
         res_u_at_gsnContourNegLineDashPattern = 1

        ; Plotting options for RH
         res_rh = res_xy
         res_rh_at_pmLabelBarOrthogonalPosF = -0.07
         res_rh_at_ContourParameters = (/ 10., 90., 10. /)
         res_at_cnFillMode = "RasterFill" ; Raster Mode
         res_at_cnLinesOn = False ; Turn off contour lines
         res_at_cnLineLabelsOn = False ; Turn off contour lines
         res_rh_at_cnFillOn = True
         res_rh_at_cnFillColors = (/"White", "White","White",\
                                             "White","DarkOliveGreen1","Chartreuse","Green",
\
                                             "Green3", \
                                             "ForestGreen","PaleGreen4"/)

        ; Plotting options for ETH, Equivalent Pot Temperature
         res_eth = res_xy
         res_eth_at_cnInfoLabelOrthogonalPosF = 0.00
         res_eth_at_cnLineColor = "Blue"
         res_eth_at_cnLineThicknessF = 1.0
         res_eth_at_cnLineLabelFontHeightF = 0.020
         res_eth_at_cnLabelMasking = True ; do not draw labels over
contour
         res_eth_at_ContourParameters = (/ 320., 376., 2. /)

        ; Get the contour info (from WRF NCL example)
          contour_u = wrf_contour(a,wks,zave_u,res_u)
          contour_rh = wrf_contour(a,wks,zave_rh,res_rh)
          contour_eth = wrf_contour(a,wks,zave_eth,res_eth)

        ; MAKE PLOTS
         pltres_at_FramePlot = False ; do not frame plot - will do this
later

         plot =
wrf_overlays(a,wks,(/contour_eth,contour_u,contour_rh/),pltres)

         res_at_gsnRightString = ""
         res_at_gsnLeftString = ""
         res_at_gsnCenterString = ""

; testing shaded contour for eth > 343K
         res_eth_at_cnLinesOn = False ; Turn off contour lines
         res_eth_at_cnLineLabelsOn = False ; Turn off contour labels
         res_eth_at_cnMonoFillColor = True ; default color is fground
[black]
         res_eth_at_cnMonoFillPattern = False ; want multiple patterns
         res_eth_at_cnMonoFillScale = False ; want patterns w/ diff
densities
         res_eth_at_gsnShadeFillType = "Pattern"
         res_eth_at_gsnShadeHigh = 17 ; Use fill pattern #17 (stipple)

; plot=gsn_contour(wks,zave_eth,res_eth) ; plot zonal ave of eth
         plot = gsn_contour_shade(plot,-999.,343., res_eth) ; Pattern
shade contours above 343

  draw(plot)
  frame(wks)

;***********************************************
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 02 2009 - 10:47:42 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 03 2009 - 07:55:08 MDT