[ncl-talk] contour labels

Marston Ward marston.johnston at gu.se
Wed Apr 4 09:42:28 MDT 2018


Hi,

I’m trying to get the contour labels to show up on each contour as well as control the size of the labels so that the labels do not cross many contours.
But I’m not getting this to work with the following resource setup:

 wksd  := gsn_open_wks ("png",oname)

      info_string = "IWP: 0 to .4 by .1"
      cnres                           = True
      cnres at gsnDraw                   = False
      cnres at gsnFrame                  = False
      cnres at cnLinesOn                 = True
      cnres at cnLineColor               = "DarkOrchid4"
      cnres at cnFillOn                  = False
      cnres at cnLineLabelsOn            = True
      cnres at cnLineThicknessF          = 2.0
      cnres at cnLineLabelBackgroundColor= -1    ; transparent
      cnres at cnInfoLabelOrthogonalPosF = -0.25    ; Move into plot
      ;cnres at cnLineLabelInterval       = 1
      ;cnres at cnLineLabelFontHeightF    = 0.0001
      cnres at cnInfoLabelString         = info_string
      cnres at cnInfoLabelFontColor      = "DarkOrchid4"
      cnres at cnInfoLabelPerimOn        = False
      cnres at tfDoNDCOverlay            = True  ; Line up four axes of both plots.
      cnres at cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels
      cnres at cnMinLevelValF       = 0.              ; set min contour level
      cnres at cnMaxLevelValF       = .4              ; set max contour level
      cnres at cnLevelSpacingF      = .1             ; set contour spacing

      cnres at tiYAxisString        = “"
      cnres at tiXAxisString        = “"

I’m using the above resource to create overlays on contour plots that will be a panel plot, for example:

plotd(0) = gsn_csm_contour_map_overlay(wksd,p(0,:,:),iwp,resd,cnres)
      
However, I cannot get the labels to change change to a smaller size or show up on ever contour, of which there are 5 possible, given the max, min, and spacing.

Would love to get some help with this if anyone has an idea what part of the resource above is incorrect or missing additional information.

Best,
/Marston


More information about the ncl-talk mailing list