<div dir="ltr"><div class="gmail_default" style="font-size:small">I think you need to set:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div style="color:rgb(80,0,80);font-size:12.8px">  vcres@tfDoNDCOverlay           = True</div><div><br></div><div>You&#39;ve already set up the map projection for the contours over the map and set tfDoNDCOverlay to True for that plot. By setting tfDoNDCOverlay to True for the vector plot, you&#39;re telling the vector plot that the transformation has already been done.  It will thus line up the four corners of the vector plot with the four corners of your contour/map plot.</div><div><br></div><div>--Mary</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 10, 2016 at 7:41 AM, Ciao Kai Liang <span dir="ltr">&lt;<a href="mailto:ciaokailiang@gmail.com" target="_blank">ciaokailiang@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Rick, <div><br><div>Thank for suggestion. after I modify my code, the two plot  are overlaid now (see attached) but since I use my own defined projection, the contour plot match well but the vector cannot. Do you have any suggest to fix this problem? I&#39;ve tried assign mp resource to vector but it conflicts. Thx in advance.</div><div><br></div><div>Joe</div><div>The revised code is as follows</div><div><br></div><div><div>  u  = f1-&gt;UWIND(0,0,:,:) ;U at timestep 0 135x90</div><div>  v  = f1-&gt; VWIND(0,0,:,:) ;V at timestep 0 135x90</div><div>  ox = f3-&gt;O3(0,0,:,:)    ;ozone concentration at timestep 0 135x90</div></div><div><span class=""><div><br></div><div>  wks = gsn_open_wks(&quot;png&quot;,&quot;overlay&quot;)</div></span><div>  sfile =&quot;/nas02/depts/ese/chaq/ckliang/TWN/shape/TWN_adm2.shp&quot;</div><div>  gsn_define_colormap(wks,&quot;cmp_haxby&quot;)</div><div><br></div><div>;Map============================================</div><div>  mpres                                         = True</div><div>  mpres@gsnDraw                       = False</div><div>  mpres@gsnFrame                     = False</div><span class=""><div>  mpres@mpProjection                = &quot;LambertConformal&quot;</div><div>  mpres@mpLambertParallel1F  = 10.0</div><div>  mpres@mpLambertParallel2F  = 40.0</div><div>  mpres@mpLambertMeridianF   = 120.0</div><div>  mpres@tfDoNDCOverlay           = True</div><div>  mpres@mpLimitMode                = &quot;Corners&quot;</div><div>  mpres@mpLeftCornerLonF       = LON(0,0,0,0)</div><div>  mpres@mpLeftCornerLatF        = LAT(0,0,0,0)</div><div>  mpres@mpRightCornerLonF     = LON(0,0,dimsizes(LAT(0,0,:,0))-1,dimsizes(LAT(0,0,0,:))-1)</div><div>  mpres@mpRightCornerLatF     = LAT(0,0,dimsizes(LAT(0,0,:,0))-1,dimsizes(LAT(0,0,0,:))-1)</div><div><br></div><div>  mpres@mpDataSetName             = &quot;Earth..4&quot;   ; This new database contains</div><div>  mpres@mpDataBaseVersion        = &quot;MediumRes&quot;  ; Medium resolution database</div><div>  mpres@mpOutlineOn                   = True         ; Turn on map outlines</div></span><div>  mpres@mpFillOn                           = True         ; Turn on map fill</div><span class=""><div>  mpres@mpOutlineBoundarySets  = &quot;AllBoundaries&quot;</div><div>  mpres@mpGridAndLimbOn          = True</div><div>  mpres@mpGridLineDashPattern  = 2</div><div>  mpres@mpCenterRotF                = 90.0</div></span><div>  mpres@gsnSpreadColors            = True             ; use full colormap</div><div>;;Contour=============================================================</div></div><div><div>  mpres@cnFillOn                        = True</div><div>  mpres@cnFillMode                    = &quot;RasterFill&quot;     ; use raster mode</div><div>  mpres@cnLinesOn                    = False</div><div>  mpres@gsnMaximize                = True             ; Maximize the plot where it is drawn</div><div>  mpres@gsnSpreadColors          = True             ; use full colormap</div><div>  mpres@cnLevelSelectionMode = &quot;ManualLevels&quot;</div><div>  mpres@cnMinLevelValF            = 5.     ; set the minimum contour level</div><div>  mpres@cnMaxLevelValF           = 100.   ; set the maximum contour level</div><div>  mpres@cnLevelSpacingF          = 5      ; set the contour interval</div><div>  mpres@lbLabelStride                = 1</div><div>  mpres@lbLabelFont                   = &quot;times-roman&quot;</div><div><br></div><div>;;set vector==========================================================</div><div>  vcres                                           = True</div><span class=""><div>  vcres@gsnDraw                         = False</div><div>  vcres@gsnFrame                      = False</div></span><div>  vcres@vcMinFracLengthF          = 0.0   ;-- length of min vector as</div><div>  vcres@vcRefMagnitudeF          = 10.0  ;-- make vectors larger</div><div>  vcres@vcRefLengthF                = 0.045 ;-- ref vec length</div><div>  vcres@vcMinDistanceF            = 0.01  ;-- thin out vectors</div><div>  vcres@gsnLeftString                = &quot;&quot;</div><div>  vcres@gsnRightString             = &quot;&quot;</div><div>  vcres@tiMainString                   = &quot;Wind profile October 1 2010 00:00&quot;; vector curly</div><div>  vcres@vcGlyphStyle                 = &quot;CurlyVector&quot;</div></div><div><div>;;plot====================================================================</div><div>  contour = gsn_csm_contour_map(wks,ox*1000.,mpres)</div><div>  vector  = gsn_csm_vector(wks,u,v,vcres)</div><div>  ;shapefile<br></div><span class=""><div>  lnres                  = True</div><div>  lnres@gsLineColor      = &quot;gray25&quot;</div><div>  lnres@gsLineThicknessF = 1.0</div></span><div>  twn_id1 = gsn_add_shapefile_polylines(wks,contour,sfile,lnres)</div><div>  twn_id2 = gsn_add_shapefile_polylines(wks,vector,sfile,lnres)</div><div><br></div><div>  draw(contour)       ; This will draw the map and the shapefile outlines.</div><div>  draw(vector)</div><div>  frame(wks)           ; Advance the frame</div><div>end</div></div><div><br></div><div>  </div></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">2016-07-08 23:44 GMT+08:00 Rick Brownrigg <span dir="ltr">&lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br></div>Looking at your plot, the reference vector generated by the vector plot and the label bar generated by the contour plot are both present on the map.  I&#39;d recommend taking a close look at the underlying data to make sure units, values, and spatial extent is what you think it is.  <br><br></div>Hope that helps...<br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Jul 8, 2016 at 1:16 AM, Ciao Kai Liang <span dir="ltr">&lt;<a href="mailto:ciaokailiang@gmail.com" target="_blank">ciaokailiang@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Dear alll ncl users, </div><div><br></div><div>I try to make a plot of overlaying the wind speed (vector) and the ozone concentration (contour) on the map. The wind speed vector is from MCIP output and ozone concentration from CMAQ model. No error message occurs but I get blank on the map(attached). Is something wrong in my script? Thx in advance.</div><div><br></div><div>Joe</div><div><br></div><div><div>;read files=============================================================</div><div>f1 = addfile(&quot;METDOT3D&quot;,&quot;r&quot;)<br></div><div>f2 = addfile(&quot;<a href="http://CCTM_D502a_Linux2_x86_64ifort.ACONC.CMAQ20101001.nc" target="_blank">CCTM_D502a_Linux2_x86_64ifort.ACONC.CMAQ20101001.nc</a>&quot;,&quot;r&quot;)</div><div><br></div><div>u = f1-&gt;UWINDC(0,0,:,:) ;U at timestep 0  by 90X135</div><div>v = f1-&gt;VWINDC(0,0,:,:) ;V at timestep 0    by 90X135</div><div>ox = f2-&gt;O3(0,0,:,:)         ;ozone concentration at timestep 0  by 90X135</div></div><div><br></div><div>;set evn===============================================================</div><div><div>wks = gsn_open_wks(&quot;png&quot;,&quot;overlay&quot;)</div><div>gsn_define_colormap(wks,&quot;WhiteBlueGreenYellowRed&quot;)</div></div><div><br></div><div><div>vcres                      = True  ;Vector</div><div><div>vcres@gsnDraw    = False</div><div>vcres@gsnFrame  = False</div></div><div>cnres                      = vcres ;Contour<br></div><div>mpres                     = vcres ;Map</div></div><div><br></div><div><div>;Contour===============================================================</div><div> cnres@gsnDraw              = False</div><div> cnres@gsnFrame           = False</div><div><br></div><div> cnres@cnFillOn               = True</div><div> cnres@cnFillMode           = &quot;RasterFill&quot;     ; use raster mode</div><div> cnres@cnLinesOn            = False</div><div> cnres@tmYROn               = False            ; Turn off right tickmarks.</div><div> cnres@tmXTOn               = False            ; Turn off top tickmarks.</div><div> cnres@tmXBLabelFont        = &quot;times-roman&quot;</div><div> cnres@tmYLLabelFont        = &quot;times-roman&quot;</div><div> cnres@gsnMaximize          = True             ; Maximize the plot where it is drawn</div><div> cnres@gsnSpreadColors      = True             ; use full colormap</div><div><br></div><div> cnres@cnLevelSelectionMode = &quot;ManualLevels&quot;</div><div> cnres@cnMinLevelValF            = 10.  ; set the minimum contour level</div><div> cnres@cnMaxLevelValF           = 120.   ; set the maximum contour level</div><div> cnres@cnLevelSpacingF          = 10.    ; set the contour interval</div><div> cnres@lbLabelStride                 = 1</div></div><div><div> cnres@lbLabelFont          = &quot;times-roman&quot;</div><div><br></div><div> cnres@tmXBLabelFontHeightF = 0.015</div><div> cnres@tmYLLabelFontHeightF = 0.015</div></div><div><br></div><div><div>;Vector=============================================</div><div>  vcres@vcLevelSelectionMode     = &quot;ManualLevels&quot;</div><div>  vcres@vcMinLevelValF                = -20.0</div><div>  vcres@vcMaxLevelValF               = 100.0</div><div>  vcres@vcLevelSpacingF              = 10.0</div><div>  vcres@vcLevelPalette                  = &quot;amwg_blueyellowred&quot;   ; assign color map to vectors</div><div><br></div><div>  vcres@vcGlyphStyle                       = &quot;LineArrow&quot;</div><div>  vcres@vcLineArrowThicknessF      = 5</div><div>  vcres@vcMinDistanceF                   = 0.01</div><div>  vcres@vcRefLengthF                       = 0.03</div><div><br></div><div>  vcres@vcGlyphStyle                          = &quot;WindBarb&quot;</div><div>  vcres@vcWindBarbLineThicknessF   = 5</div><div>  vcres@vcWindBarbColor                   = &quot;Gray40&quot;</div><div><br></div><div>  vcres@vcRefAnnoOn               = True</div><div>  vcres@vcRefMagnitudeF           = 30</div><div>  vcres@vcRefAnnoString1          = &quot;30&quot;</div><div>  vcres@vcRefAnnoSide             = &quot;Top&quot;</div></div><div><div>  vcres@vcRefAnnoString2On        = False</div><div>  vcres@vcRefAnnoPerimOn          = False</div><div>  vcres@vcRefAnnoOrthogonalPosF   = -0.12</div><div>  vcres@vcRefAnnoParallelPosF     = 0.999</div><div>  vcres@vcRefAnnoBackgroundColor  = &quot;Purple&quot;</div><div>  vcres@vcVectorDrawOrder         = &quot;PostDraw&quot;</div><div>  vcres@gsnRightString            = &quot;Wind&quot;</div></div><div><br></div><div><div>;Map============================================</div><div>  mpres@mpProjection               = &quot;LambertConformal&quot;</div><div>  mpres@mpLambertParallel1F  = 10.0</div><div>  mpres@mpLambertParallel2F  = 40.0</div><div>  mpres@mpLambertMeridianF   = 120.0</div><div>  mpres@tfDoNDCOverlay          = True</div><div>  mpres@mpLimitMode               = &quot;Corners&quot;</div><div>  mpres@mpLeftCornerLonF      = LON(0,0,0,0)</div><div>  mpres@mpLeftCornerLatF       = LAT(0,0,0,0)</div><div>  mpres@mpRightCornerLonF    = LON(0,0,dimsizes(LAT(0,0,:,0))-1,dimsizes(LAT(0,0,0,:))-1)</div><div>  mpres@mpRightCornerLatF      = LAT(0,0,dimsizes(LAT(0,0,:,0))-1,dimsizes(LAT(0,0,0,:))-1)</div><div><br></div><div>  mpres@mpDataSetName          = &quot;Earth..4&quot;   ; This new database contains</div><div>  mpres@mpDataBaseVersion     = &quot;MediumRes&quot;  ; Medium resolution database</div><div>  mpres@mpOutlineOn                 = True         ; Turn on map outlines</div><div>  mpres@mpFillOn                         = True </div></div><div><div>  mpres@mpOutlineBoundarySets  = &quot;AllBoundaries&quot;</div><div>  mpres@mpGridAndLimbOn        = True</div><div>  mpres@mpGridLineDashPattern  = 2</div><div>  mpres@mpCenterRotF                 = 90.0</div><div><br></div><div>  mpres@mpLabelsOn                   = False</div><div>  mpres@mpPerimOn                    = True</div><div>  mpres@mpGridAndLimbOn        = False</div><div>  mpres@mpOutlineDrawOrder     = &quot;PostDraw&quot;</div><div>  mpres@mpFillDrawOrder            = &quot;Predraw&quot;</div><div>  mpres@mpOceanFillColor           = &quot;lightskyblue1&quot;</div><div>  mpres@mpLandFillColor               = &quot;gray&quot;</div><div><br></div><div>  mpres@mpGridAndLimbDrawOrder = &quot;Predraw&quot;<br></div><div>  mpres@tiMainString           =  &quot;October 1 2010 ozone concentration(ppm)&quot;</div></div><div><br></div><div><div><div>;=====================================================================</div><div>  vcid = gsn_csm_vector(wks,u,v,vcres)</div><div>  cnid = gsn_csm_contour(wks,ox*1000.,cnres)</div><div>  mpid = gsn_csm_map(wks,mpres)</div><div><br></div><div>;---Attach the shapefile polylines using files read off <a href="http://gadm.org/country" target="_blank">gadm.org/country</a>.</div><div>  lnres                  = True</div><div>  lnres@gsLineColor      = &quot;gray25&quot;</div><div>  lnres@gsLineThicknessF = 1.0</div><div>  twn_id = gsn_add_shapefile_polylines(wks,mpid,sfile,lnres)</div></div><div><br></div><div>;---Overlay contour, streamline, and vector plots on the map plot.</div><div>  overlay(mpid,cnid)</div><div>  overlay(mpid,vcid)</div><div><br></div><div>  draw(mpid)</div><div>  frame(wks)</div><div><br></div><div>  maximize_output(wks,True)</div><div>end</div></div><div><br></div>
</div>
<br></div></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>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>---------------------------------------------------------------------------------------------------------</div>CiaoKai Liang<div><a href="tel:919-808-8069" value="+19198088069" target="_blank">919-808-8069</a></div><div><a href="mailto:ckliang@live.unc.edu" target="_blank">ckliang@live.unc.edu</a></div><div>University of North Carolina, Gillings School of Global Public Health<br>170 Rosenau Hall, CB #7400 | 135 Dauer Drive | Chapel Hill, NC 27599-7400</div><div>------------------------------------------------------------------------------------------------------------</div><div><br></div></div></div>
</font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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>
<br></blockquote></div><br></div>