<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hello Mary</p>
<p><br>
</p>
<p> "<span>pltres@gsnMaximize = False</span>" worked for me! </p>
<p> Thank you so much!</p>
<p><br>
</p>
<p>Xiaoming </p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Mary Haley <haley@ucar.edu><br>
<b>Sent:</b> Thursday, January 5, 2017 11:03 AM<br>
<b>To:</b> Xiaoming Hu<br>
<b>Cc:</b> xiaoming Hu; ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] different orientations depending on output png or eps, wrf_overlays</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">I was unable to run your script because of an error:</div>
<div class="gmail_default">
<p class="gmail-p1" style="font-size:small"><span class="gmail-s1"><font face="monospace, monospace">fatal:Subscript out of range, error in subscript #0</font></span></p>
<p class="gmail-p1" style="font-size:small"><span class="gmail-s1"><font face="monospace, monospace">fatal:An error occurred reading zcordinate</font></span></p>
<p class="gmail-p1" style="font-size:small"><span class="gmail-s1"><font face="monospace, monospace">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 256 in file wrf_CrossSection_WSPplusVecter_positive90tilt_smooth_for2ndMax_combine_another.ncl</font></span></p>
<p class="gmail-p1" style="font-size:small"><span class="gmail-s1">I made a small modification to get it to run.</span></p>
<p class="gmail-p1" style="font-size:small"><span class="gmail-s1">For starters, you </span>cannot use "gsn" resources in a "setvalues" call. "gsn" resources are only meant to be passed to various gsn_xxxx or wrf_xxx routines (in some cases).</p>
<p class="gmail-p1" style="font-size:small">Part of the issue is that you are trying to use wrf_xxxx routines for plotting some highly customized plots. The wrf_xxxx routines are really meant to be used as "black box" type of scripts without a lot of plot customizations.
I always tell users that if they want to do major customizations, to use the gsn_csm_xxx scripts.</p>
<p class="gmail-p1" style="font-size:small">However, having said all that, the real issue is that whenever you set gsnMaximize to True, this is going to cause your plots to be maximized in whatever output device you are sending it to, including having the plot
rotated if it fits better in a landscape orientation.</p>
<p class="gmail-p1" style="font-size:small">Many of the wrf_xxxx plotting routines set gsnMaximize to True under the hood, so in order to turn this off, you have to set gsnMaximize to FAlse. wrf_overlays is one of those routines that sets gsnMaximize to True,
so I suggest setting this resource before you call wrf_overlays:</p>
<p class="gmail-p1"> pltres@gsnMaximize = False</p>
<p class="gmail-p1">Remove *all* other settings of gsnMaximize set in your code, and any references to gsnPaperOrientation, wkOrientation, and gsnOrientation (which is not a valid resource, byt the way). Since "portrait" is the default mode, you don't need
to set any orientation resources.</p>
<p class="gmail-p1"><br>
</p>
<p class="gmail-p1">--Mary</p>
<p class="gmail-p1"><br>
</p>
<p class="gmail-p1"><br>
</p>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jan 5, 2017 at 8:57 AM, Xiaoming Hu <span dir="ltr">
<<a href="mailto:xhu@ou.edu" target="_blank">xhu@ou.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div bgcolor="#FFFFFF">
<div class="m_-7573275015846317441moz-cite-prefix">Hello Mary<br>
<br>
Thanks a lot!<br>
I actually used "vpYF" : 0.9-ispecies*0.3484, see below:<br>
<br>
"<br>
plot = wrf_overlays(a,wks,(/contour_<wbr>theta,vector,contour_ter,<wbr>contour_ter3/),pltres)<br>
setvalues contour_theta<br>
"vpHeightF" : 0.34<br>
; "vpYF" : 0.93-ispecies*0.34084<br>
"vpYF" : 0.9-ispecies*0.3484<br>
; "vpWidthF" : 0.35<br>
; "vpXF" : 0.15+ispecies*0.355<br>
"tiMainOffsetYF" : -0.01<br>
; "gsnRightString" : "RString" ; res@TimeLabel<br>
"gsnPaperOrientation" : "portrait"<br>
"tmXBLabelFontHeightF" : 0.0182<br>
"tiYAxisFontHeightF" : 0.01820 ; effective<br>
"tmYLLabelFontHeightF" : 0.0182<br>
"tiXAxisFontHeightF" : 0.0182<br>
"tiYAxisOffsetXF" : 0.012<br>
"tmYLLabelDeltaF" : -0.8<br>
<br>
end setvalues<br>
"<br>
<br>
I tested "res@gsnMaximize = True" as you suggested, I still got (when output eps)<br>
<br>
But if I output png, then it is portrait (i.e., rotated)<br>
<br>
I put my script and input data at <br>
<a class="m_-7573275015846317441moz-txt-link-freetext" href="http://www.caps.ou.edu/micronet/WRF-UCM/FocusON_OKC/WRFV3.7.1/with_rr_fixed/wrfNARR2d_UCM_Snudge_WangRec53wave.2002_2015Mean/wrf_CrossSection_WSPplusVecter_positive90tilt_smooth_for2ndMax_combine_another.ncl" target="_blank">http://www.caps.ou.edu/<wbr>micronet/WRF-UCM/FocusON_OKC/<wbr>WRFV3.7.1/with_rr_fixed/<wbr>wrfNARR2d_UCM_Snudge_<wbr>WangRec53wave.2002_2015Mean/<wbr>wrf_CrossSection_<wbr>WSPplusVecter_positive90tilt_<wbr>smooth_for2ndMax_combine_<wbr>another.ncl</a><br>
<a class="m_-7573275015846317441moz-txt-link-freetext" href="http://www.caps.ou.edu/micronet/WRF-UCM/FocusON_OKC/WRFV3.7.1/with_rr_fixed/wrfNARR2d_UCM_Snudge_WangRec53wave.2002_2015Mean/wrfout_d02_21_ncea_14yrAugmean_wrfNARR2d_UCM_Snudge_WangRec53wave.nc" target="_blank">http://www.caps.ou.edu/<wbr>micronet/WRF-UCM/FocusON_OKC/<wbr>WRFV3.7.1/with_rr_fixed/<wbr>wrfNARR2d_UCM_Snudge_<wbr>WangRec53wave.2002_2015Mean/<wbr>wrfout_d02_21_ncea_<wbr>14yrAugmean_wrfNARR2d_UCM_<wbr>Snudge_WangRec53wave.nc</a><br>
You should be able to run the script.<br>
<br>
Thanks a lot!<br>
Xiaoming <br>
<a class="m_-7573275015846317441moz-txt-link-freetext" href="http://xiaominghu.oucreate.com/" target="_blank">http://xiaominghu.oucreate.<wbr>com/</a>
<div>
<div class="h5"><br>
<br>
On 01/05/2017 09:23 AM, Mary Haley wrote:<br>
</div>
</div>
</div>
<div>
<div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi Xiaoming,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I assume you are using gsn_panel to do the final draw of these two plots.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">If so, you want to set gsnMaximize to True *and* set gsnPaperOrientation.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I've included a short script that illustrates this. Change the "orientation" variable to the desired orientation and run the script.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">--Mary</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jan 4, 2017 at 11:18 AM, xiaoming Hu <span dir="ltr">
<<a href="mailto:yuanfangcan@hotmail.com" target="_blank">yuanfangcan@hotmail.com</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">
<div id="m_-7573275015846317441m_2086245024400280268divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Interesting, I got <span>different orientations depending on output png or eps. If I output png, I got portrait, but I got landscape if I output eps.</span></p>
<p><span><br>
</span></p>
<p><span>See my output figure</span></p>
<p><span><a href="http://www.caps.ou.edu/micronet/WRF-UCM/FocusON_OKC/WRFV3.7.1/with_rr_fixed/wrfNARR2d_UCM_Snudge_WangRec53wave.2002_2015Mean/wrfout_d02_W_crossSN90_2ndMax_smooth_partial_8.png" class="m_-7573275015846317441m_2086245024400280268OWAAutoLink" id="m_-7573275015846317441m_2086245024400280268LPlnk126675" target="_blank">http://www.caps.ou.edu/microne<wbr>t/WRF-UCM/FocusON_OKC/WRFV3.7.<wbr>1/with_rr_fixed/wrfNARR2d_UCM_<wbr>Snudge_WangRec53wave.2002_<wbr>2015Mean/wrfout_d02_W_<wbr>crossSN90_2ndMax_smooth_<wbr>partial_8.png</a><br>
</span></p>
<p><br>
</p>
<p><a href="http://www.caps.ou.edu/micronet/WRF-UCM/FocusON_OKC/WRFV3.7.1/with_rr_fixed/wrfNARR2d_UCM_Snudge_WangRec53wave.2002_2015Mean/wrfout_d02_W_crossSN90_2ndMax_smooth_partial_8.eps" class="m_-7573275015846317441m_2086245024400280268OWAAutoLink" id="m_-7573275015846317441m_2086245024400280268LPlnk285887" target="_blank">http://www.caps.ou.edu/microne<wbr>t/WRF-UCM/FocusON_OKC/WRFV3.7.<wbr>1/with_rr_fixed/wrfNARR2d_UCM_<wbr>Snudge_WangRec53wave.2002_<wbr>2015Mean/wrfout_d02_W_<wbr>crossSN90_2ndMax_smooth_<wbr>partial_8.eps</a><br>
</p>
<p><br>
</p>
<p>See my script:</p>
<p><a href="http://www.caps.ou.edu/micronet/WRF-UCM/FocusON_OKC/WRFV3.7.1/with_rr_fixed/wrfNARR2d_UCM_Snudge_WangRec53wave.2002_2015Mean/wrf_CrossSection_WSPplusVecter_positive90tilt_smooth_for2ndMax_combine_another.ncl" class="m_-7573275015846317441m_2086245024400280268OWAAutoLink" id="m_-7573275015846317441m_2086245024400280268LPlnk507481" target="_blank">http://www.caps.ou.edu/microne<wbr>t/WRF-UCM/FocusON_OKC/WRFV3.7.<wbr>1/with_rr_fixed/wrfNARR2d_UCM_<wbr>Snudge_WangRec53wave.2002_<wbr>2015Mean/wrf_CrossSection_WSPp<wbr>lusVecter_positive90tilt_smoot<wbr>h_for2ndMax_combine_another.<wbr>ncl</a><br>
</p>
<p><br>
</p>
<p>I tried a few resources (including <span style="font-size:12pt">gsnPaperOrientation<wbr>, </span><span style="font-size:12pt">wkOrientation = "portrait" </span>) to rotate the eps orientation, but all failed. Currently landscape, I want portrait. </p>
<p><br>
</p>
<p>Any suggestions?</p>
<p><br>
</p>
<p> Thanks a lot!</p>
<span class="m_-7573275015846317441HOEnZb"><font color="#888888">
<p>Xiaoming </p>
<p><br>
</p>
</font></span></div>
</div>
<br>
______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<p><br>
</p>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>