<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Thanks Mary! &nbsp;I’ll fiddle around with this!
<div class=""><br class="">
</div>
<div class="">-Jonathan</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 2, 2016, at 11:55 PM, Mary Haley &lt;<a href="mailto:haley@ucar.edu" class="">haley@ucar.edu</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_default" style="font-size:small">Hi Jonathan,</div>
<div class="gmail_default" style="font-size:small"><br class="">
</div>
<div class="gmail_default" style="font-size:small">The gsn_csm_attach_zonal_means_plot is really meant for just one zonal means, and doesn't have any hooks for extra lines.</div>
<div class="gmail_default" style="font-size:small"><br class="">
</div>
<div class="gmail_default" style="font-size:small">There's unadvertised function called gsn_csm_zonal_means which is called by the gsn_csm_attach_zonal_means plot. It basically creates the XY zonal means plot under the hood and returns it. The gsn_csm_attach_zonal_means&nbsp;function
 calls this function and then attaches the zonal plot to the right of an existing map plot.</div>
<div class="gmail_default" style="font-size:small"><br class="">
</div>
<div class="gmail_default">Using gsn_csm<font face="arial, helvetica, sans-serif" class="">_zonal_means, I created the two zonal means plots myself, used &quot;overlay&quot; to overlay them into one plot, and then attached the overlaid XY plots myself using gsn_add_annotation.</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class=""><br class="">
</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">See the attached zonal.ncl example and resultant PNG image.&nbsp; I didn't have time to find a dataset that would produce a more interesting zonal plot, so I just used a standard one that
 you can download from:</font></div>
<div class="gmail_default">
<p class="gmail-p1"><font face="arial, helvetica, sans-serif" class=""><a href="http://www.ncl.ucar.edu/Applications/Data/cdf/ts_Amon_CESM1-CAM5_historical_r1i1p1_185001-200512.nc" class="">http://www.ncl.ucar.edu/Applications/Data/cdf/ts_Amon_CESM1-CAM5_historical_r1i1p1_185001-200512.nc</a></font></p>
<p class="gmail-p1"><font face="arial, helvetica, sans-serif" class="">You will likely want to modify the &quot;<span style="font-variant-ligatures:no-common-ligatures" class="">attach_zonal_plots_to_map_plot&quot; function in this script to customize how you want the
 zonal means plots to appear, for example, what color to use for the XY lines, how wide to make the plot, what X/Y axes min/max values you want, etc.</span></font></p>
<p class="gmail-p1"><font face="arial, helvetica, sans-serif" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">--Mary</span></font></p>
<p class="gmail-p1"><font face="arial, helvetica, sans-serif" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class="">
</span></font></p>
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Wed, Nov 2, 2016 at 2:44 PM, Buzan, Jonathan R <span dir="ltr" class="">
&lt;<a href="mailto:jbuzan@purdue.edu" target="_blank" class="">jbuzan@purdue.edu</a>&gt;</span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">Hi NCL,
<div class=""><br class="">
</div>
<div class="">I am attempting to plot zonal means of my two sets of data.&nbsp; However, every time it tries to plot the zonal means, even with the same&nbsp;trXMaxF and&nbsp;trXMinF, the zonal plots do not match on the same grid (see attached).&nbsp; Is there a way to fix this?</div>
<div class=""><br class="">
</div>
<div class="">-Jonathan</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">ex. plot lines.</div>
<div class=""><br class="">
</div>
<div class="">&nbsp; zres@trXMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0. &nbsp; &nbsp; &nbsp;; Could also use gsnZonalMeanXMinF<br class="">
&nbsp; zres@trXMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 3. &nbsp; &nbsp; &nbsp;; Could also use gsnZonalMeanXMaxF<br class="">
&nbsp; zres@trYMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= -57<br class="">
&nbsp; zres@trYMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;57<br class="">
&nbsp; zres1@trXMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0. &nbsp; &nbsp; &nbsp;; Could also use gsnZonalMeanXMinF<br class="">
&nbsp; zres1@trXMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 3. &nbsp; &nbsp; &nbsp;; Could also use gsnZonalMeanXMaxF<br class="">
&nbsp; zres1@trYMinF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= -57<br class="">
&nbsp; zres1@trYMaxF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;57<br class="">
</div>
<div class=""><br class="">
</div>
&nbsp; &nbsp; plots = gsn_csm_contour_map(wks,tmp_<wbr class="">var(:,:),res)<br class="">
&nbsp; &nbsp; plots1 = gsn_csm_contour(wks,tmp_var1(:<wbr class="">,:),res2)<br class="">
&nbsp; &nbsp; plots1 &nbsp;= gsn_contour_shade(plots1,<wbr class="">minshade,maxshade,opt)<br class="">
overlay(plots,plots1)<br class="">
&nbsp; zonal_id1 = gsn_csm_attach_zonal_means(<wbr class="">wks,plots,tmp_var1(:,:),zres)<br class="">
<div class="">&nbsp; zonal_id2 = gsn_csm_attach_zonal_means(<wbr class="">wks,plots,tmp_var(:,:),zres1)<br class="">
</div>
<div class=""><span id="cid:1D9532AA-ECDC-42AF-AA83-BD649287567F">&lt;plot.png&gt;</span></div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/<wbr class="">mailman/listinfo/ncl-talk</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
<span id="cid:82EA1C1A-7111-493F-BD31-2B484B369728">&lt;two_zonal_plots.png&gt;</span><span id="cid:4A1825A3-5F74-429A-BE83-6F7C8E18F523">&lt;zonal.ncl&gt;</span></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>