<div>Hi Adam,</div><div><br></div><div>Thank you very much! The example is very helpful! I use the function "overlay" to superimpose vectors over contours.</div><div><br></div><div>However, the vectors seem different with the one I plot using GrADS (see below), and I don't know why. Could you help me look at my script? One more question is, how to reverse the X-Y coordinates?</div><div>Attached is the data if it is needed.</div><div><br></div><div>Much appreciated and best regards,</div><div>Qi</div><div><br></div><div>ncl plot:</div><div><img src="cid:2E0CC6FE@B0B6B648.89BBB055"></div><div><br></div><div>my script:</div><div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"</div><div>;************************************************</div><div>begin</div><div>;************************************************</div><div>; variable and file handling</div><div>;************************************************</div><div> in = addfile("erai-qvint-zonmean.nc","r")</div><div> qu = in->quz(:,:,0) </div><div> qv = in->qvz(:,:,0)</div><div> qdiv = in->qflxdiv(:,:,0) </div><div> time = in->time</div><div> lat = in->lat</div><div><br></div><div>;************************************************</div><div>; plotting</div><div>;************************************************</div><div> wks = gsn_open_wks("eps","eri-qhov") ; Opens a eps file</div><div> ;gsn_define_colormap(wks,"WhiteBlueGreenYellowRed") ; choose colormap</div><div> </div><div> res = True</div><div> res@gsnDraw = False</div><div> res@gsnFrame = False</div><div>;</div><div>; Set up some contour resources.</div><div>;</div><div>; Turn on contour fill, and turn other things off.</div><div>;</div><div> res@cnFillOn = True</div><div> res@cnLinesOn = False</div><div> res@cnInfoLabelOn = False</div><div><br></div><div>;</div><div>; Define contour levels and their colors.</div><div>;</div><div> ;cnres@cnLevelSelectionMode = "ManualLevels"</div><div> ;cnres@cnMinLevelValF = 980.0</div><div> ;cnres@cnMaxLevelValF = 1040.0</div><div> ;cnres@cnLevelSpacingF = 5.0</div><div> ;cnres@cnFillPalette = "StepSeq25" ; assign color map to contours</div><div><br></div><div> </div><div> res@trYReverse = True ; time from top to bottom, small to big</div><div>; Set special resources for the time axis</div><div> resTick = True</div><div> resTick@ttmFormat = "%d %c" ; form like "1 Jun", %d means day, %c means calendar</div><div> resTick@ttmAxis = "YL" ; Y axis, Left </div><div><br></div><div>; Set resources necessary to customize Y axis labels</div><div> time_axis_labels( time, res, resTick )</div><div> </div><div> vecres = True ; vector only resources</div><div> vecres@gsnDraw = False</div><div> vecres@gsnFrame = False</div><div> vecres@vcRefMagnitudeF = 600000 ; define vector ref mag</div><div> vecres@vcRefAnnoOrthogonalPosF = -.535 ; move ref vector into plot</div><div> </div><div> cnid = gsn_csm_contour(wks,qdiv,res)</div><div> vcid = gsn_csm_vector(wks,qu,qv,vecres)</div><div> overlay(cnid,vcid)</div><div> maximize_output(wks,True)</div><div>end</div><div><br></div></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b> "Adam Phillips";<asphilli@ucar.edu>;</div><div><b>Date: </b> Tue, Jul 21, 2015 04:02 AM</div><div><b>To: </b> "LI Qi"<liqi123sh@qq.com>; <wbr></div><div><b>Cc: </b> "ncl-talk"<ncl-talk@ucar.edu>; <wbr></div><div><b>Subject: </b> Re: [ncl-talk] hovmoller diagrams for vectors</div></div><div><br></div><div dir="ltr"><div><div><div><div>Hi Qi,<br></div>I believe you will want to use the gsn_csm_vector_scalar plotting function. For an example showing how this function is used see example #6 here:<br><a href="http://www.ncl.ucar.edu/Applications/overlay.shtml#ex6">http://www.ncl.ucar.edu/Applications/overlay.shtml#ex6</a><br></div><div>(see the overlay_6_new.ncl script)<br></div><div><br></div>This example does not show a latitude/time plot but gsn_csm_vector_scalar should still work for your needs.<br><br></div>Hope that helps. If not or if you have further questions please respond to ncl-talk.<br></div>Adam <br><div><div><div><div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 18, 2015 at 7:29 PM, LI Qi <span dir="ltr"><<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Dear NCL community,</div><div><br></div><div>I would like to create latitude vs. time plot for moisture flux in vectors.</div><div>But the function gsn_csm_lat_time seems to be used for scalar fieids.</div><div><br></div><div>The data I have contains (qu,qv) over a limited area.</div><div>Below is a figure I plotted using GrADS for reference. How could I plot it using NCL?</div><div><br></div><div>Any suggestion would be much appreciated!</div><div><br></div><div>Best,</div><div>Qi</div></div><div><br></div><div><img src="cid:664A2A39@B0B6B648.89BBB055" style="width:690px;min-height:534px"></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><br clear="all"><br>-- <br><div 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>
</div></div>