Re: labelbar problem

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu May 23 2013 - 09:47:37 MDT

There's something strange going on here. You are getting two sets of tick mark labels.

This might have to do with you setting:

> res@pmTickMarkDisplayMode = "Always"

and also setting the various "res@tmXXX" resources. I think that when you set the above resource, then the "tmXXX" resources can't be changed.

Try *not* setting res@pmTickMarkDisplayMode for a start.

The other issue is that your Y axis title is running into your tick marks. I think this is due to the fact that you are making them rather large.

Try setting something like:

   res@tiYAxisOffsetXF = -0.08

--Mary

On May 22, 2013, at 1:04 AM, Xin Xi wrote:

> Sorry, that should be lblabel issue, nothing wrong with labelbar.
>
>
> On Wed, May 22, 2013 at 12:54 AM, Xin Xi <xxi@gatech.edu> wrote:
> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu May 23 09:47:55 2013

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