[ncl-talk] Sub: cn labels contradicts with lb label bar..

Adv advita6 at gmail.com
Sun Mar 20 22:03:03 MDT 2016


Hi,
In second and third spatial plots, cn labels are not consistent with lb
label bar. There is a shift. I have attached here a figure for your review.
Could someone help me to resolve this issue?

Thank you

;**************************************************
; plot parameters
;**************************************************

wks = gsn_open_wks("pdf","eof")
  gsn_define_colormap(wks,"BlWhRe")       ; choose colormap
;  gsn_define_colormap(wks,"testcmap")       ; choose colormap
  plot = new(neof,graphic)                ; create graphic array
                                          ; only needed if paneling
; EOF patterns

  res                      = True
  res at gsnDraw              = False        ; don't draw yet
  res at gsnFrame             = False        ; don't advance frame yet

;---This resource not needed in V6.1.0
  res at gsnSpreadColors      = True         ; spread out color table

  res at gsnAddCyclic         = False        ; plotted dataa are not cyclic

  res at mpFillOn             = False        ; turn off map fill
  res at mpMinLatF            = eof&lat(0)         ; zoom in on map
  res at mpMaxLatF            = eof&lat(nlat-1)
res at mpMinLonF            = eof&lon(0)
  res at mpMaxLonF            = eof&lon(mlon-1)
 res at cnFillOn             = True         ; turn on color fill
  res at cnLinesOn            = True        ; True is default
;res at cnLineLabelsOn       = False
  res at lbLabelBarOn         = False        ; turn off individual lb's
res at mpGeophysicalLineThicknessF = 3.0
res at mpGeophysicalLineColor = "Black"; (/22/)
res at mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state boundaries
res at mpNationalLineColor  = res at mpGeophysicalLineColor
res at mpUSStateLineThicknessF = 3.0
res at mpUSStateLineColor  = res at mpGeophysicalLineColor


                                          ; set symmetric plot min/max
;  symMinMaxPlt(eof, 16, False, res)       ; contributed.ncl

; panel plot only resources
  resP                     = True         ; modify the panel plot
  resP at gsnMaximize         = True         ; large format
  resP at gsnPanelLabelBar    = True         ; add common colorbar
resP at lbLabelAutoStride   = True         ; auto stride on labels

  yStrt                    = yyyymm(0)/100
  yLast                    = yyyymm(nyrs-1)/100
  resP at txString            = "Reanalysis_Temp(C) DJF EOF: "+season+":
"+yStrt+"-"+yLast

;*******************************************
; first plot
;*******************************************
  do n=0,neof-1
     res at gsnLeftString  = "EOF "+(n+1)
     res at gsnRightString = sprintf("%5.1f", eof at pcvar(n)) +"%"
     plot(n)=gsn_csm_contour_map_ce(wks,eof(n,:,:),res)
  end do
  gsn_panel(wks,plot,(/neof,1/),resP)               ; now draw as one plot
;  txres               = True
;  txres at txFontHeightF = 0.015
;  gsn_text_ndc(wks,"Figure 16: A smaller panel plot",0.5,0.16,txres)
  frame(wks)
;*******************************************
; second plot
;*******************************************
; EOF time series  [bar form]

  rts           = True
  rts at gsnDraw   = False       ; don't draw yet
  rts at gsnFrame  = False       ; don't advance frame yet
  rts at gsnScale  = True        ; force text scaling

; these four rtsources allow the user to stretch the plot size, and
; decide exactly where on the page to draw it.

  rts at vpHeightF = 0.40        ; Changes the aspect ratio
  rts at vpWidthF  = 0.85
  rts at vpXF      = 0.10        ; change start locations
  rts at vpYF      = 0.75        ; the plot


  rts at tiYAxisString = "deg C"                    ; y-axis label
 rts at gsnYRefLine           = 0.              ; reference line
  rts at gsnXYBarChart         = True            ; create bar chart
  rts at gsnAboveYRefLineColor = "red"           ; above ref line fill red
  rts at gsnBelowYRefLineColor = "blue"          ; below ref line fill blue

; panel plot only resources
 rtsP                      = True            ; modify the panel plot
  rtsP at gsnMaximize          = True            ; large format
  rtsP at txString             = "Reanalysis_Temp(C) DJF EOF "+season+":
"+yStrt+"-"+yLast

  year = yyyymm/100

; create individual plots
  do n=0,neof-1
     rts at gsnLeftString  = "EOF "+(n+1)
     rts at gsnRightString = sprintf("%5.1f", eof at pcvar(n)) +"%"
     plot(n) = gsn_csm_xy (wks,year+0,eof_ts(n,:),rts)
  end do
  gsn_panel(wks,plot,(/neof,1/),rtsP)     ; now draw as one plot

end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160320/c076cf29/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eof_Reanal_temp1965-2005.pdf
Type: application/pdf
Size: 151378 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160320/c076cf29/attachment.pdf 


More information about the ncl-talk mailing list