labelbar problem

From: Xin Xi <xxi_at_nyahnyahspammersnyahnyah>
Date: Tue May 21 2013 - 22:54:42 MDT

Hello,
I have this problem with the labelbar. See the attached figure. It has two
sets of coordinates superimposed with each other. Please help to correct
this. Thanks!

Here is my res and resP:
   res = True
   res@gsnDraw = False
   res@gsnFrame = False
   res@gsnSpreadColors = True
   res@gsnSpreadColorStart = 144
   res@gsnSpreadColorEnd = -1

   res@cnFillOn = True
   res@cnLinesOn = False
   res@cnLineLabelsOn = False
   res@cnFillMode = "AreaFill"
   res@cnLevelSelectionMode = "ExplicitLevels"
   res@cnLevels = (/.1, .2, .3, .4, .5, .6, .7, .8, .9/)

   res@lbLabelBarOn = False
   res@pmTickMarkDisplayMode = "Always"

   res@mpLimitMode = "Corners"
   res@mpLeftCornerLatF = latS
   res@mpLeftCornerLonF = lonL
   res@mpRightCornerLatF = latN
   res@mpRightCornerLonF = lonR

   res@mpFillOn = False
   res@mpOutlineOn = True
   res@mpDataBaseVersion = "MediumRes"
   res@mpOutlineBoundarySets = "AllBoundaries"
   res@mpNationalLineThicknessF = 1.5
   res@mpGeophysicalLineThicknessF = 1.5
   res@mpGridAndLimbOn = True
   res@mpGridSpacingF = 5.0
   res@mpGridLineThicknessF = 0.5

   res@gsnAddCyclic = False

   nplt = 2*nyear
   plts = new(nplt,graphic)

   res@tmXTOn = False
   res@tmXBOn = False
   res@tmYROn = False
   res@tmYLLabelsOn = True
   res@tmYLOn = True
   res@tmYLLabelFontHeightF = 0.035
   res@tmYLLabelDeltaF = -0.5

   tifont = 0.05
   res@tiYAxisFontHeightF = tifont

   do i = 0, nyear-1
      if (i .eq. 0) then
         res@tiXAxisSide = "top"
         res@tiXAxisFontHeightF = tifont
         res@tiXAxisString = "Cropland"
      else
         res@tiXAxisOn = False
      end if

      if (i .eq. nyear-1) then
         res@tmXBOn = True
         res@tmXBLabelsOn = True
      end if

      res@tiYAxisString = years(i)
      plts(2*i) = gsn_csm_contour_map(wks,crop_luh(i,:,:),res)
   end do

   res@tmXBOn = False
   res@tmYLOn = False
   res@tiYAxisOn = False
   res@tmYROn = True
   res@tmYRLabelsOn = True

   do i=0,nyear-1
  ; res@gsnPanelYF=0.5
      if (i .eq. 0) then
         res@tiXAxisOn = True
         res@tiXAxisSide = "top"
         res@tiXAxisFontHeightF = tifont
         res@tiXAxisString = "Pasture"
      else
         res@tiXAxisOn =False
      end if
      if (i .eq. nyear-1) then
         res@tmXBOn=True
         res@tmXBLabelsOn = True
      end if

      plts(2*i+1) = gsn_csm_contour_map(wks,past_luh(i,:,:),res)
   end do

; create panel
   resP = True
   resP@gsnMaximize = True
   resP@gsnPanelCenter = False
   resP@gsnPanelLabelBar = True
   resP@pmLabelBarWidthF = 0.50
   resP@pmLabelBarHeightF = 0.05

   resP@lbTitleString = "%"
   resP@lbTitlePosition = "Right"
   resP@lbTitleFontHeightF = 0.02

   resP@lbLabelFontHeightF = 0.015
   resP@lbLabelStrings = (/10, 20, 30, 40, 50, 60, 70, 80, 90/)
   xfadj = 0.5
   resP@gsnPanelXF =
(/-1,xfadj,-1,xfadj,-1,xfadj,-1,xfadj,-1,xfadj,-1,xfadj/)

   resP@gsnPanelLeft = 0.1
   resP@gsnPanelRight = 0.95
   resP@gsnPanelBottom = 0.05
   resP@gsnPanelTop = 0.95
   resP@gsnPanelScalePlotIndex = 3
   resP@gsnPanelYWhiteSpacePercent = 1.2
   resP@gsnPanelXWhiteSpacePercent = 0.0
   gsn_panel(wks,plts,(/nyear,2/),resP)

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

luh.png
Received on Tue May 21 22:54:54 2013

This archive was generated by hypermail 2.1.8 : Thu May 30 2013 - 11:38:10 MDT