<div dir="ltr"><div class="gmail_default" style="font-size:small">I&#39;m not sure why the two sets of vectors are not showing up the same, but my guess is that they have different default reference vectors with different magnitudes.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To debug this, as usual, I suggest first commenting out the vcRefMagnitudeF, vcRefLengthF, etc, type of resources, and draw each plot individually before you overlay them, so you can see what NCL chooses for the default magnitude and reference length. You will need to make sure vcRefAnnoOn is not set to False, and that gsnDraw and gsnFrame are not set to False.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As for the second question, it looks like you almost already have the vectors in a line, correct?  The default NCL behavior is to center the vector, but you can specify that you want either the head or the tail of the vector to be at the x,y coordinate location.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">See example vector_7.ncl at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/vector.shtml#ex7">http://www.ncl.ucar.edu/Applications/vector.shtml#ex7</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">which illustrates how to change this behavior using the vcPositionMode.</div><div class="gmail_default"><br></div><div class="gmail_default">As another possibility, you might try using wmvect instead of trying to do a vector plot. See example weather_sym_8.ncl at:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/weather_sym.shtml">http://www.ncl.ucar.edu/Applications/weather_sym.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">I recommend this as a last resort, however, because using gsn_csm_vector will give you more customization over the vectors.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 4, 2016 at 7:17 PM, grace <span dir="ltr">&lt;<a href="mailto:313695096@qq.com" target="_blank">313695096@qq.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>Hi:</div><div>  All,I am trying to compare the wind data of wrfout with observations of one station,like the picture below,</div><div><img src="cid:9915746C@D1828918.9FC7CC57" style="width:1148px;min-height:182px"></div><div>Here is my strategy:</div><div>First, I extracted the data and put them into two different arrys,draw two differert xy plot with same manual timelabels on X axis,but arrowline with different color.</div><div>Then I overlay them.</div><div>But the picture I drawed is like this:</div><div><img src="cid:E94CEA3B@D1828918.9FC7CC57.jpg"></div><div>No matter how reset the resourses ,the vc_res only works on the first plot(plot A),<span style="font-family:&#39;lucida Grande&#39;,Verdana,&#39;Microsoft YaHei&#39;;line-height:23.8px">How can I slove the problem?</span></div><div><span style="font-family:&#39;lucida Grande&#39;,Verdana,&#39;Microsoft YaHei&#39;;line-height:23.8px">One more question,How can I set the linearrows on a line and set the Y axis as the speed value that corresponding the wind speed of the wind vector?Just like the first picture in this email.</span></div><div><span style="font-family:&#39;lucida Grande&#39;,Verdana,&#39;Microsoft YaHei&#39;;line-height:23.8px">Any information will be appreciated.</span></div><div><br></div><div>This is my script:</div><div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot; </div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot; </div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl&quot;</div><div><br></div><div>begin</div><div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot; </div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot; </div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl&quot;</div><div><br></div><div>begin</div><div>;</div><div>; The WRF ARW input file.  </div><div>; This needs to have a &quot;.nc&quot; appended, so just do it.</div><div>  a = addfile(&quot;/backup/hl/<wbr>wrfout201508/wrfout_d03_2015-<wbr>08-01_12:00:<a href="http://00.nc" target="_blank">00.nc</a>&quot;,&quot;r&quot;)     </div><div><br></div><div>    ij = wrf_user_ll_to_ij(a, 108.966667,34.433333,True)</div><div><br></div><div>    print(&quot;lon location is: &quot; +ij(0))</div><div><br></div><div>    print(&quot;lat location is: &quot; + ij(1))</div><div><br></div><div>; First get the variables we will need </div><div>u10_2=new((/31,24/),float,&quot;No_<wbr>FillValue&quot;)</div><div>v10_2=new((/31,24/),float,&quot;No_<wbr>FillValue&quot;)</div><div><br></div><div> </div><div> filename1=systemfunc(&quot;ls /backup/hl/wrfout201508/<wbr>wrfout_d03_2015-08*.nc&quot;)</div><div>         fin1=addfiles(filename1,&quot;r&quot;)</div><div>         do i=0,30</div><div>            </div><div>                 u10_1=fin1[i]-&gt;U10(0:23,ij(1)<wbr>-1, ij(0)-1)</div><div>                 v10_1=fin1[i]-&gt;V10(0:23,ij(1)<wbr>-1, ij(0)-1)</div><div>                 u10_2 (i,:)= u10_1  </div><div>                 v10_2 (i,:)= v10_1  </div><div>        end do   </div><div>                          u10=ndtooned(u10_2)</div><div>                          v10=ndtooned(v10_2)</div><div><br></div><div>                          u10_d=u10(0:724)</div><div>                          v10_d=v10(0:724)</div><div>                          printVarSummary(u10_d(0))</div><div>                          printVarSummary(v10_d(0))</div><div><br></div><div>;;;;;;;;;;;;;;;get obs data;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;       </div><div>  ascii_filename = &quot;/public/home/huanglei/txt_<wbr>obs/obs.txt&quot;</div><div>  seismic = asciiread(ascii_filename,(/<wbr>725,6/),&quot;float&quot;)</div><div>  seismic@_FillValue = -999</div><div>     wdir = seismic(:,4)</div><div>     wspd = seismic(:,5)</div><div>     tmp = (270.0-wdir)*0.01745329</div><div>     u_o = wspd*cos(tmp)</div><div>     v_o = wspd*sin(tmp)</div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;data for plot1;;;;;;;;;;;;;;;;a is model data ; b is obs data;;;;;;;;;;;;;;;;;;;;;;;</div><div> u10_new1a=new((/25,220/),<wbr>float)</div><div> u10_new1a=0  </div><div> u10_new1a(8,:)=u10_d(0:219)</div><div> v10_new1a=new((/25,220/),<wbr>float)</div><div> v10_new1a=0</div><div> v10_new1a(8,:)=v10_d(0:219)</div><div><br></div><div> u10_new1b=new((/25,220/),<wbr>float)</div><div> u10_new1b=0  </div><div> u10_new1b(8,:)=u_o(0:219) </div><div> v10_new1b=new((/25,220/),<wbr>float)</div><div> v10_new1b=0</div><div> v10_new1b(8,:)=v_o(0:219)</div><div><br></div><div><br></div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;</div><div>wks  = gsn_open_wks(&quot;pdf&quot;,&quot;gsn_<wbr>vector_panel&quot;)          ; open a Graphic wkStation</div><div>  res  = True                                      ; plot mods desired</div><div>  res@gsnFrame  = False</div><div>  res@gsnDraw   = False                          ; don&#39;t draw</div><div><br></div><div>  res@vcGlyphStyle     = &quot;LineArrow&quot;             ; turn on LineArrow</div><div>  res@gsnMaximize = True  </div><div>  res@vpHeightF   = 0.15</div><div>  res@vpWidthF    = 0.8</div><div> </div><div>  res@pmLegendWidthF         = 0.10                  ; Change width and</div><div>  res@pmLegendHeightF        = 0.10                  ; height of legend.</div><div>  res@tmYLOn             = False        ; Don&#39;t draw labels for left</div><div>  res@tmYLLabelsOn       = False        ;  Y axes</div><div>  res@tmYROn             = False        ; Don&#39;t draw labels for right</div><div>  res@tmYRLabelsOn       = False        ;  Y axes</div><div>  res@tmXBLabelFontHeightF = 0.01</div><div>  res@vcRefAnnoOrthogonalPosF = -0.258             ; move ref vector up</div><div>  res@vcRefMagnitudeF         = 1.0            ; define vector ref mag</div><div>  res@vcRefLengthF            = 0.01            ; define length of vec ref</div><div>  res@vcRefAnnoParallelPosF     = 0.999</div><div>  res@vcRefAnnoFontHeightF =0.005</div><div>  res@vcRefAnnoString2   =&quot; &quot;</div><div>  res@vpHeightF   = 0.15</div><div>  res@vpWidthF   = 0.8</div><div><br></div><div> ;res@tmYLLabelFontColor = line_col1    ;</div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;add text TEST / OBS;;;;;;;</div><div>    res_text               = True</div><div>    res_text@txFontHeightF = 0.01</div><div>   </div><div>    m1 = &quot;TEST&quot;</div><div>    m2 = &quot;OBS&quot;</div><div><br></div><div> ;;;;;;;;;;;;;;;;;resources for plot(0);;;;;;;;;;;;;;</div><div><br></div><div>  res0a=res</div><div>  res0a@tmXBMode =&quot;Explicit&quot;  </div><div>  res0a@tmXBValues  =(/5,29,53,77,101,125,149,<wbr>173,197/)</div><div>  res0a@tmXBLabels = (/&quot;5/2&quot;,&quot;5/3&quot;,&quot; 5/4&quot;,&quot;5/5&quot;, &quot;5/6&quot;,&quot;5/7&quot;,&quot;5/8&quot;,&quot;5/9&quot;,&quot;5/10&quot;<wbr>/)</div><div><br></div><div>  res0a@vcMonoLineArrowColor = True</div><div>  res0a@vcLineArrowColor = &quot;black&quot;</div><div>  plotA = gsn_csm_vector(wks, u10_new1a, v10_new1a,res0a)</div><div><br></div><div>  res0b=res</div><div>  res0b@tmXBMode =&quot;Explicit&quot;  </div><div>  res0b@tmXBValues  =(/5,29,53,77,101,125,149,<wbr>173,197/)</div><div>  res0b@tmXBLabels = (/&quot;5/2&quot;,&quot;5/3&quot;,&quot; 5/4&quot;,&quot;5/5&quot;, &quot;5/6&quot;,&quot;5/7&quot;,&quot;5/8&quot;,&quot;5/9&quot;,&quot;5/10&quot;<wbr>/)</div><div><br></div><div>  res0b@vcMonoLineArrowColor = True</div><div>  res0b@vcLineArrowColor = &quot;red&quot;</div><div>   res0b@vcRefAnnoOrthogonalPosF = -0.258             ; move ref vector up</div><div>  res0b@vcRefMagnitudeF         = 1.0            ; define vector ref mag</div><div>  res0b@vcRefLengthF            = 0.01            ; define length of vec ref</div><div>  res0b@vcRefAnnoParallelPosF     = 0.999</div><div>  res0b@vcRefAnnoFontHeightF =0.005</div><div>  res0b@vcRefAnnoString2   =&quot; &quot;</div><div><br></div><div>  plotB = gsn_csm_vector(wks, u10_new1b, u10_new1b,res0b)</div><div>   </div><div>   overlay(plotA,plotB)                      ; result will be plotA</div><div>   plot = plotA                           ; now assign plotA to array</div><div><br></div><div> gsn_text(wks,plot(0),m1,190,<wbr>10,res_text)</div><div> gsn_text(wks,plot(0),m2,190,<wbr>35,res_text)</div><div><br></div><div> draw(plot)</div><div>;frame(wks)</div><div>end</div></div></div><div><br></div><div><br></div><div></div><br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>