[ncl-talk] Overlay on panel plots

Nkese Mc Shine Nkese.McShine at sta.uwi.edu
Tue May 7 09:06:54 MDT 2019


Good day everyone,

I would like to overlay 12 wind direction vector maps on 12 wind speed maps however I keep getting an error. Can anyone assist?

Thanking you in advance.

Regards,
Nkese.

My script:

;;create plots

wks   = gsn_open_wks("ps","Caribbeanwinds_monthly6")
plot  = new(12,graphic)
plots = new(12,graphic)

  res                             = True
  res at gsnDraw             = False           ; don't draw
  res at gsnFrame           = False           ; don't advance frame
  res at cnFillOn             = True            ; turn on color
  res at gsnMaximize      = True

  cmap = read_colormap_file("BkBlAqGrYeOrReViWh200")
  res at cnFillPalette       = cmap(25:170,:)  ; set color map

  res at cnLinesOn              = False           ; no contour lines
  res at lbLabelBarOn         = False

  res at gsnLeftString          = "Speed"         ; change left string
  res at gsnRightString        = uwnd_practice at units  ; assign right string

  res at mpDataSetName                  = "Earth..4"
  res at mpDataBaseVersion              = "MediumRes"
  res at mpOutlineOn                        = True

  res at mpGeophysicalLineThicknessF = 2
  res at mpNationalLineThicknessF      = 2
  res at mpFillDrawOrder                    = "PostDraw"
  res at mpFillOn                                 = False          ; no map fill

  res at mpMinLatF           = 0
  res at mpMaxLatF          = 30
  res at mpMinLonF          = -110
  res at mpMaxLonF         = -30

  vecres                                = True          ; vector only resources
  vecres at gsnDraw                = False          ; don't draw
  vecres at gsnFrame              = False          ; don't advance frame
  vecres at vcGlyphStyle         = "LineArrow"    ; curly vectors
  vecres at vcRefMagnitudeF  = 10             ; define vector ref mag
  vecres at vcRefLengthF        = 0.045          ; define length of vec ref

  vecres at vcLineArrowThicknessF      = 1
  vecres at vcMinDistanceF                  = 0.05

  vecres at gsnRightString   = " "            ; turn off right string
  vecres at gsnLeftString     = " "            ; turn off left string
  vecres at tiXAxisString      = " "            ; turn off axis label
  vecres at vcRefAnnoOrthogonalPosF = -1.0   ; move ref vector into plot

  months = (/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug",\
             "Sep","Oct","Nov","Dec"/)

  resP                  = True                           ; panel only resources
  resP at gsnPanelLabelBar = True
  resP at gsnMaximize      = True                ; maximize plots


     do nmo=0,11
         res at gsnCenterString=months(nmo)
         vecres at gsnCenterString=months(nmo)
         plot(nmo)  = gsn_csm_contour_map_ce(wks,wspd_monthly(nmo,:,:),res)
         plots(nmo) = gsn_csm_vector_map(wks,uwnd_monthly(nmo,:,:),vwnd_monthly(nmo,:,:),vecres)
         overlay(plot(nmo),plots(nmo))
         plot       = plot(nmo)
     end do


  gsn_panel(wks,plot,(/3,4/),resP)


Error:
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member
 warning:MapSetTrans: map limits invalid - using maximal area
 fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA
 warning:MapSetTrans: map limits invalid - using maximal area
 fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA
 warning:MapSetTrans: map limits invalid - using maximal area
 fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA
 warning:MapSetTrans: map limits invalid - using maximal area
 fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA
 warning:MapSetTrans: map limits invalid - using maximal area
 fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA
 warning:MapSetTrans: map limits invalid - using maximal area
 fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA
 warning:MapSetTrans: map limits invalid - using maximal area
 fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA

CONFIDENTIALITY: This email (including any attachments) may contain confidential, proprietary and/or privileged information. Any duplication, copying, distribution, dissemination, transmission, disclosure or use in any manner of this email (including any attachments) without the authorisation of the sender is strictly prohibited. If you receive this email (including any attachments) in error, please notify the sender and delete this email (including any attachments) from your system. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190507/052c1c77/attachment.html>


More information about the ncl-talk mailing list