<div><span style="line-height: 1.5;">Hi Dave,</span></div><div><div><div>It works like a charm! Thank you very much!</div><div><br></div><div>Hi Adam,</div><div>Sorry for my misleading expression...what I really want is to swap the X/Y axes, i.e., to make the Time-latitude plot to a Latitude-time plot.</div><div><br></div><div>Then I reorder the variable's dimensions, like:</div><div><br></div><div>; variable's original order (time, lat, lon)</div><div> qu = in->quz(:,:,0)</div><div>; reorder (lat, time)</div><div> qu_new = qu(lat | :, time | :)</div><div> </div><div>But the figure's coordinate doesn't show latitudes and timeline (shown below). What do I do? Or is there any other way to swap the axis? </div><div><br></div><div>Thanks again!</div><div>Qi</div></div><div><br></div><div><img src="cid:2B07F50A@875A3F53.01B1B155"></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> Fri, Jul 24, 2015 02:28 AM</div><div><b>To: </b> "David Brown"<dbrown@ucar.edu>; <wbr></div><div><b>Cc: </b> "LI Qi"<liqi123sh@qq.com>; "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>Hi Qi,<br></div>Adding to Dave's email: If you want to reverse your X/Y axes you can set trYReverse / trXReverse:<br><a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/tr.shtml#trXReverse">www.ncl.ucar.edu/Document/Graphics/Resources/tr.shtml#trXReverse</a><br><a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/tr.shtml#trYReverse">www.ncl.ucar.edu/Document/Graphics/Resources/tr.shtml#trYReverse</a><br></div>Adam<br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 11:58 AM, David Brown <span dir="ltr"><<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>></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 Qi,<div>I am guessing you need to set vcMapDirection to False. This needs to be set when you plot vectors with axes with coordinates that are not geographic.</div><div> -dave</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 4:01 AM, 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>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:26F70827@875A3F53.01B1B155"></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("<a href="http://erai-qvint-zonmean.nc" target="_blank">erai-qvint-zonmean.nc</a>","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";<<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>>;</div><div><b>Date: </b> Tue, Jul 21, 2015 04:02 AM</div><div><b>To: </b> "LI Qi"<<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>>; </div><div><b>Cc: </b> "ncl-talk"<<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>>; </div><div><b>Subject: </b> Re: [ncl-talk] hovmoller diagrams for vectors</div></div><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" target="_blank">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:881EDA52@875A3F53.01B1B155" style="width:690px;min-height:534px"></div><br>_______________________________________________<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><br clear="all"><br>-- <br><div><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"><a value="+13034971726" target="_blank">303-497-1726</a> </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></div></div><br>_______________________________________________<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"><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>