<div dir="ltr">Hi Nkese,<div>I see two issues:</div><div>1) A plot that is to be overlaid on another plot cannot be created by one of the *_map* plotting routines. So change this:</div><div><span style="color:rgb(0,0,0);font-family:Tahoma">plots(nmo) = gsn_csm_vector_map(wks,uwnd_</span><span style="color:rgb(0,0,0);font-family:Tahoma">monthly(nmo,:,:),vwnd_monthly(</span><span style="color:rgb(0,0,0);font-family:Tahoma">nmo,:,:),vecres)</span><br></div><div><span style="color:rgb(0,0,0);font-family:Tahoma">to this:</span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma">plots(nmo) = gsn_csm_vector(wks,uwnd_</span><span style="color:rgb(0,0,0);font-family:Tahoma">monthly(nmo,:,:),vwnd_monthly(</span><span style="color:rgb(0,0,0);font-family:Tahoma">nmo,:,:),vecres)</span><span style="color:rgb(0,0,0);font-family:Tahoma"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma">2) You are overwriting your plot array every time through your loop. Change this:</span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma"> overlay(plot(nmo),plots(nmo))</span><br style="color:rgb(0,0,0);font-family:Tahoma"><span style="color:rgb(0,0,0);font-family:Tahoma"> plot = plot(nmo)</span><br style="color:rgb(0,0,0);font-family:Tahoma"><span style="color:rgb(0,0,0);font-family:Tahoma"> end do </span><br style="color:rgb(0,0,0);font-family:Tahoma"><span style="color:rgb(0,0,0);font-family:Tahoma"> gsn_panel(wks,plot,(/3,4/),</span><span style="color:rgb(0,0,0);font-family:Tahoma">resP)</span><span style="color:rgb(0,0,0);font-family:Tahoma"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma">to this:</span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma"> overlay(plot(nmo),plots(nmo))</span><br style="color:rgb(0,0,0);font-family:Tahoma"><span style="color:rgb(0,0,0);font-family:Tahoma"> end do </span><br style="color:rgb(0,0,0);font-family:Tahoma"><span style="color:rgb(0,0,0);font-family:Tahoma"> gsn_panel(wks,plot,(/3,4/),</span><span style="color:rgb(0,0,0);font-family:Tahoma">resP)</span><span style="color:rgb(0,0,0);font-family:Tahoma"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma">Adam</span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Tahoma;font-size:13.3333px"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 7, 2019 at 9:15 AM Nkese Mc Shine <<a href="mailto:Nkese.McShine@sta.uwi.edu">Nkese.McShine@sta.uwi.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:rgb(0,0,0);font-size:10pt">Good day everyone,<br>
<br>
I would like to overlay 12 wind direction vector maps on 12 wind speed maps however I keep getting an error. Can anyone assist?<br>
<br>
Thanking you in advance.<br>
<br>
Regards,<br>
Nkese.<br>
<br>
My script:<br>
<br>
;;create plots<br>
<br>
wks = gsn_open_wks("ps","Caribbeanwinds_monthly6")<br>
plot = new(12,graphic)<br>
plots = new(12,graphic)<br>
<br>
res = True<br>
res@gsnDraw = False ; don't draw<br>
res@gsnFrame = False ; don't advance frame<br>
res@cnFillOn = True ; turn on color<br>
res@gsnMaximize = True <br>
<br>
cmap = read_colormap_file("BkBlAqGrYeOrReViWh200")<br>
res@cnFillPalette = cmap(25:170,:) ; set color map<br>
<br>
res@cnLinesOn = False ; no contour lines<br>
res@lbLabelBarOn = False<br>
<br>
res@gsnLeftString = "Speed" ; change left string<br>
res@gsnRightString = uwnd_practice@units ; assign right string<br>
<br>
res@mpDataSetName = "Earth..4"<br>
res@mpDataBaseVersion = "MediumRes"<br>
res@mpOutlineOn = True<br>
<br>
res@mpGeophysicalLineThicknessF = 2<br>
res@mpNationalLineThicknessF = 2<br>
res@mpFillDrawOrder = "PostDraw"<br>
res@mpFillOn = False ; no map fill<br>
<br>
res@mpMinLatF = 0<br>
res@mpMaxLatF = 30<br>
res@mpMinLonF = -110<br>
res@mpMaxLonF = -30<br>
<br>
vecres = True ; vector only resources<br>
vecres@gsnDraw = False ; don't draw<br>
vecres@gsnFrame = False ; don't advance frame<br>
vecres@vcGlyphStyle = "LineArrow" ; curly vectors<br>
vecres@vcRefMagnitudeF = 10 ; define vector ref mag<br>
vecres@vcRefLengthF = 0.045 ; define length of vec ref<br>
<br>
vecres@vcLineArrowThicknessF = 1<br>
vecres@vcMinDistanceF = 0.05<br>
<br>
vecres@gsnRightString = " " ; turn off right string<br>
vecres@gsnLeftString = " " ; turn off left string<br>
vecres@tiXAxisString = " " ; turn off axis label <br>
vecres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector into plot<br>
<br>
months = (/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug",\<br>
"Sep","Oct","Nov","Dec"/)<br>
<br>
resP = True ; panel only resources<br>
resP@gsnPanelLabelBar = True<br>
resP@gsnMaximize = True ; maximize plots <br>
<br>
<br>
do nmo=0,11<br>
res@gsnCenterString=months(nmo)<br>
vecres@gsnCenterString=months(nmo)<br>
plot(nmo) = gsn_csm_contour_map_ce(wks,wspd_monthly(nmo,:,:),res)<br>
plots(nmo) = gsn_csm_vector_map(wks,uwnd_monthly(nmo,:,:),vwnd_monthly(nmo,:,:),vecres)<br>
overlay(plot(nmo),plots(nmo))<br>
plot = plot(nmo)<br>
end do <br>
<br>
<br>
gsn_panel(wks,plot,(/3,4/),resP)<br>
<br>
<br>
Error:<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member<br>
warning:MapSetTrans: map limits invalid - using maximal area<br>
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA<br>
warning:MapSetTrans: map limits invalid - using maximal area<br>
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA<br>
warning:MapSetTrans: map limits invalid - using maximal area<br>
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA<br>
warning:MapSetTrans: map limits invalid - using maximal area<br>
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA<br>
warning:MapSetTrans: map limits invalid - using maximal area<br>
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA<br>
warning:MapSetTrans: map limits invalid - using maximal area<br>
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA<br>
warning:MapSetTrans: map limits invalid - using maximal area<br>
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT - MAP HAS ZERO AREA<br>
<br>
</div>
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.
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>