<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>gsn_add_polygon is the correct route to go, and not gsn_add_annotation.</div><div><br></div><div>It looks like you are very close, but the X/Y values you're using for the polygon are not in the same coordinate space as the Skew-T plot.</div><div><br></div><div>You need to use the unadvertised "skewtx" and "skewty" functions to convert from your coordinates to the Skew-T coordinates:</div><div><br></div><div><font face="Courier">&nbsp; &nbsp; &nbsp; ybox = skewty((/p_data(0,frz_base),p_data(0,frz_top),p_data(0,frz_top),p_data(0,frz_base),p_data(0,frz_base)/))<br>&nbsp; &nbsp; &nbsp; xbox = skewtx((/30.,30.,37.,37.,30./),ybox)<br>&nbsp; &nbsp; &nbsp; box_frz = gsn_add_polygon (wks,plot,xbox,ybox,boxres)</font><br><br></div><div><br></div><div>Dennis is more familiar with this code, so I'm hoping he'll confirm whether this is correct.</div><div><br></div><div>You can see the skewtx and skewty functions for yourself in:</div><div><br></div><div>$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl</div><div><br></div><div>Search for "function skewty" and "function skewtx":</div><div><br></div><div><font face="Courier">undef("skewty")<br>function skewty(pres[*]:numeric) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; y-coord given pressure (mb)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; begin<br>&nbsp; &nbsp;return (132.182-44.061*log10(pres))<br>&nbsp; end<br><br>undef("skewtx")<br>function skewtx(temp[*]:numeric,y[*]:numeric) ; x-coord given temperature (c)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; begin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; y=skewty(p)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp;return (0.54*temp+0.90692*y)<br>&nbsp; end</font></div><div><br></div><div><br></div><div>--Mary</div><div><br><div><div>On Feb 27, 2014, at 10:42 AM, Katharina Roloff &lt;<a href="mailto:roloff@muk.uni-hannover.de">roloff@muk.uni-hannover.de</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi all,<br><br>after trying to panel some Skew-T plots last week I've now tried to add a polygon to a single Skew-T plot similar to an example of the NCL talk archive<br><br><a href="http://www.ncl.ucar.edu/Support/talk_archives/2013/1742.html">http://www.ncl.ucar.edu/Support/talk_archives/2013/1742.html</a><br><br>but unfortunately it doesn't work at all. Using the gsn_add_annotation function I get the error messages<br><br>fatal:NhlAddAnnotation: invalid view id<br>fatal:["NclVar.c":1382]:Assignment type mismatch, right hand side can't be coerced to type of left hand side<br>fatal:["Execute.c":8128]:Execute: Error occurred at or near line 186 in file Skew_T_Scenarios.ncl<br><br>When I just try to add the polygon I can't see it after plotting. Maybe you have any idea what's going wrong? I don't know if the polygon is hidden by the Skew-T background even though I tried different options to make sure that the polygon is plotted last...<br><br>In the attachment you see the shortened code and the ps output which just shows the Skew-T plot without any polygon.<br><br>If you need the input files, I've sent them via ftp in your /incoming directory:<br><br>cosmo_tools.ncl<br>grid_calculation.ncl<br>grb1_192_pip_LME_sce_k_2013110600_04_ueg<br>grb12-lm2mo_scal_2013110600_04.ueg<br>mySkewT.ncl<br><br>I am working with NCL 6.1.2. When I type "uname -a" I get<br><br><blockquote type="cite">Linux 3.1.10-1.16-desktop #1 SMP PREEMPT Wed Jun 27 05:21:40 UTC 2012 (d016078) x86_64 x86_64 x86_64 GNU/Linux<br></blockquote><br>I would appreciate any assistance again. Thank you, Katharina.<br><br><br>--------------------------------------------<br><br>M.Sc. Katharina Roloff<br>Wissenschaftliche Mitarbeiterin<br>Institut fuer Meteorologie und Klimatologie<br>Leibniz Universitaet Hannover<br>Herrenhaeuser Str. 2<br>30419 Hannover<br><br>Email: roloff@muk.uni-hannover.de<br><br>--------------------------------------------<br><span>&lt;Skew_T_Scenarios.ncl&gt;</span><span>&lt;Skew_T_frz_20131106_0400.ps&gt;</span>_______________________________________________<br>ncl-talk mailing list<br>List instructions, subscriber options, unsubscribe:<br>http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br></blockquote></div><br></div></body></html>