No negative signs in scale bar

From: Melissa Anne Pfeffer <m.a.pfeffer_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 23 2012 - 08:57:58 MDT

I'm using the following code and my scale bar, which goes from -400 -
800, does not show the negative signs, so it looks like 300 200 100 0
 100 200 ...
Can you please tell me how to get the - signs to appear? Even with
the default res@cnExplicitLabelBarLabelsOn = "False" the - signs are
not appearing.

Thank you,
Melissa

  res = True
  pltres = True ; Plot resources
  pres = True
delete(i)
 i=0
  plot = new(1,graphic)
  contourq=new(1,graphic)

      res@cnFillOn = True
      res@cnFillMode = "CellFill"
      res@cnRasterSmoothingOn=False
      res@cnSmoothingOn =False
      res@gsnSpreadColors = True
      res@cnLinesOn = False
      res@InitTime = False
      res@ValidTime = False
      res@Footer = False
      res@tiXAxisString = "Latitude [deg N]"
      res@tiYAxisString = "Height [m]"
      res@tmYLMode= "Explicit"
      res@tmYLLabelStride = 6
      res@tmYLValues= (/ispan(0,(dimsizes(NICE(i,:,i))-1),1)/)
      res@tmYLLabels=(/floattoint(z_ave(i,:,0))/)
      res@tmXBMode= "Explicit"
      res@tmXBValues= (/ispan(0,(dimsizes(NICE(i,i,:))-1),1)/)
      res@tmXBLabels=
(sprintf("%6.4g",(fspan(min(XLAT(i,:)),max(XLAT(i,:)),(floattoint(dimsizes(NICE(i,i,:)-1)/1)+1)))))
      res@tmXBLabelStride = 6
      res@tmXBAutoPrecision = False
      res@tmXBPrecision = 1
      res@gsnDraw = False ; do not draw picture
      res@gsnFrame = False ; do not advance frame
      res@lbTitlePosition = "Bottom"; move scale bar
label to right instead of default top
      pltres@NoTitles = True
      pltres@PanelPlot = True
      pltres@gsnDraw = False ; do not draw picture
      pltres@gsnFrame = False ; do not advance frame
      gsn_merge_colormaps(wks,"WhViBlGrYeOrRe","BlWhRe") ; merge two color maps
      ; colors for difference plots
       res@gsnSpreadColorStart = 110 ; now start at color
       res@gsnSpreadColorEnd = 200 ; and end at color
      ; colors for not difference plots
      ;res@gsnSpreadColorStart = 2 ; start at 4
      ;res@gsnSpreadColorEnd = 102 ; end at 15
     res@cnExplicitLabelBarLabelsOn = "True"
     delete(res@lbLabelStrings)
     res@lbLabelStrings = sprinti("%4.1i",ispan(-300,800,100))
; Format the labels

  NICEdiff@description = "NICE"
 plot(0) = wrf_contour(a[i],wks,NICEdiff(i,:,:),res)

;*******************************************
; create panel resources
;*******************************************

 pres@gsnFrame = False ; save panel until
both ready
 pres@PanelPlot = True
 pres@gsnFrame = False
 pres@gsnPanelTop = 0.9 ; draw from left
edge to center
 pres@gsnPanelLabelBar = False ; commom label bar
 pres@gsnPanelCenter = True
 pres@gsnPaperOrienation = "Portrait"

;*******************************************
;make title
;*******************************************

 text1 = create "text1" textItemClass wks
   "txString" : "Double - Ref"
   "txPosXF" : 0.53
   "txPosYF" : 0.84
   "txFontHeightF" : 0.018
  end create

draw((/text1/))
gsn_panel(wks,plot,(/1,1/),pres); 1rows, 1 columns
frame(wks)
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 23 08:58:30 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 27 2012 - 08:50:24 MDT