<div dir="ltr"><div class="gmail_default" style="font-size:small">To add this this, you may need to make sure that anything that's attached to a plot via a gsn_add_text or gsn_add_polyline call continues to "live" outside the script that it was called from. This means that the unique id returned from each of these calls must be attached as an attribute to the plot.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For example, in the procedure "addHorVertLines", you have this code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">begin</font></div><div class="gmail_default"><font face="monospace, monospace"> gsres = True</font></div><div class="gmail_default"><font face="monospace, monospace"> gsres@gsLineDashPattern = 1</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> gsn_polyline(wks, plot, x1,y1,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"> gsn_polyline(wks, plot, x1,y2,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"> gsn_polyline(wks, plot, x1,y3,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"> gsn_polyline(wks, plot, x2,y4,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> txres = True</font></div><div class="gmail_default"><font face="monospace, monospace"> txres@txJust = "CenterLeft"</font></div><div class="gmail_default"><font face="monospace, monospace"> txres@txFontHeightF = 0.013</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> gsn_text(wks, plot, "3 days" ,-14.7,.345,txres)</font></div><div class="gmail_default"><font face="monospace, monospace"> gsn_text(wks, plot, "6 days" ,-14.7,.175,txres)</font></div><div class="gmail_default"><font face="monospace, monospace"> gsn_text(wks, plot, "30 days",-14.7,.045,txres)</font></div><div class="gmail_default"><font face="monospace, monospace">end</font></div><div class="gmail_default"><br></div><div class="gmail_default">which needs to have all the gsn_polyline and gsn_text calls changed to gsn_add_polyline and gsn_add_text, but they also need to be returned from this procedure. You can use "unique_string" to generate a unique id each time:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">begin</font></div><div class="gmail_default"><font face="monospace, monospace"> gsres = True</font></div><div class="gmail_default"><font face="monospace, monospace"> gsres@gsLineDashPattern = 1</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> plot@$unique_string("poly")$ = gsn_add_polyline(wks, plot, x1,y1,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"> plot@$unique_string("poly")$ = gsn_add_polyline(wks, plot, x1,y2,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"> plot@$unique_string("poly")$ = gsn_add_polyline(wks, plot, x1,y3,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"> plot@$unique_string("poly")$ = gsn_add_polyline(wks, plot, x2,y4,gsres)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> txres = True</font></div><div class="gmail_default"><font face="monospace, monospace"> txres@txJust = "CenterLeft"</font></div><div class="gmail_default"><font face="monospace, monospace"> txres@txFontHeightF = 0.013</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> plot@$unique_string("text")$ = gsn_add_text(wks, plot, "3 days" ,-14.7,.345,txres)</font></div><div class="gmail_default"><font face="monospace, monospace"> plot@$unique_string("text")$ = gsn_add_text(wks, plot, "6 days" ,-14.7,.175,txres)</font></div><div class="gmail_default"><font face="monospace, monospace"> plot@$unique_string("text")$ = gsn_add_text(wks, plot, "30 days",-14.7,.045,txres)</font></div><div class="gmail_default"><font face="monospace, monospace">end</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">You can also do it like this, for slightly cleaner code, but it does require that you create some arrays ahead of time with "new" to hold all the text and polylines being added:</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><div class="gmail_default" style="font-family:monospace,monospace">;---Create arrays to hold polylines and text polyid = new(4,graphic)</div><div class="gmail_default" style="font-family:monospace,monospace"> textid = new(3,graphic)</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"> polyid(0) = gsn_add_polyline(wks, plot, x1,y1,gsres)</div><div class="gmail_default" style="font-family:monospace,monospace"> polyid(1) = gsn_add_polyline(wks, plot, x1,y2,gsres)</div><div class="gmail_default" style="font-family:monospace,monospace"> polyid(2) = gsn_add_polyline(wks, plot, x1,y3,gsres)</div><div class="gmail_default" style="font-family:monospace,monospace"> polyid(3) = gsn_add_polyline(wks, plot, x2,y4,gsres)</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"> txres = True</div><div class="gmail_default" style="font-family:monospace,monospace"> txres@txJust = "CenterLeft"</div><div class="gmail_default" style="font-family:monospace,monospace"> txres@txFontHeightF = 0.013</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"> textid(0) = gsn_add_text(wks, plot, "3 days" ,-14.7,.345,txres)</div><div class="gmail_default" style="font-family:monospace,monospace"> textid(1) = gsn_add_text(wks, plot, "6 days" ,-14.7,.175,txres)</div><div class="gmail_default" style="font-family:monospace,monospace"> textid(2) = gsn_add_text(wks, plot, "30 days",-14.7,.045,txres)</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">;---Make sure polyid and textid continue to "live" outside this procedure </div><div class="gmail_default" style="font-family:monospace,monospace"> plot@unique_string("poly") = polyid</div><div class="gmail_default" style="font-family:monospace,monospace"> plot@unique_string("text") = textid</div><div class="gmail_default"><br></div><div class="gmail_default">See the attached diagnostics_cam_panel.ncl. This is UNTESTED, but hopefully it gives you an idea where to start.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 28, 2017 at 8:54 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@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"><div>When I wrote the functions, my focus was on doing the computations and graphics correctly. Paneling the graphics was not a priority. To be honest, I did not even think about paneling. :-(<br></div><div><br>It would be possible to restructure ('refactor') the code. However, it would require some time and .effort. <br></div><div>[1] copy the code:<br></div><div> cp $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/diagnostics_<wbr>cam.ncl diagnostics_cam.panel.ncl<br><br>[2] Change the local code: add 'res@gsnDraw=False' in multiple places; change 'polyline' procedure calls to the 'gsn_add_polyline' functions, etc <br><br>---<br><br></div><div>Perhaps, using Imagemagick's 'convert' tool. <br><br></div><div>%> convert <return><br><br></div><div>See the -append /+append options<br><br><div>I have not used the 'append' option very often. 'convert' has other
options that may also be of use. See: <br><br> <a href="http://www.imagemagick.org/Usage/layers/" target="_blank">http://www.imagemagick.org/Usa<wbr>ge/layers/</a><br><br></div>This link has numerous examples. <br></div><div><br>------<br><br></div><div>Consider image1.png, image2.png, image3.png, image4.png<br><br>%> convert -append image1.png image2.png IMAGE_12.TopBottom.png<br></div><div>%> display IMAGE_12.TopBottom.png<br><br></div><div>%> convert -append image3.png image4.png IMAGE_34.TopBottom.png<br>%> display IMAGE_34.TopBottom.png<br><br>%> convert +append IMAGE_12.TopBottom.png IMAGE_34.TopBottom.png IMAGE_2x2.png<br></div><div>%> display IMAGE_2x2.png<br><br>---<br></div><div>This type of thing could be invoked within an NCL script to save manually doing it. How?<br>After the 'image[1-4].png' have been created .... EG<br><br><pre> w<span style="font-family:arial,helvetica,sans-serif">kSpaceTime (u, diro, case, VAR, ,latBound, spd , nDayWin, nDaySkip, opt ) ; create images
</span></pre></div><div> system("convert -append image1.png image2.png IMAGE_12.TopBottom.png")<br></div><div> system("convert -append image3.png image4.png IMAGE_34.TopBottom.png")<br></div><div> system("convert +append IMAGE_12.TopBottom.png IMAGE_34.TopBottom.png IMAGE_2x2.png")<br></div><div> system("rm IMAGE*TopBottom.png")</div><div><br>---<br>Two on top; one at bottom<br><br>%> convert +append image1.png image2.png IMAGE_12.LeftRight.png<br><div>%> display IMAGE_12.LeftRight.png<br><br></div><div>%> convert -append IMAGE_12.LeftRight.png image3.png IMAGE_123.png<br>%> display IMAGE_123.png<br><br></div><div>I am sure you can 'center' the bottom figure but I'll leave that up to you. :-)<br></div><br>----<br></div><div>From the above link: 10 figures<br></div><div><pre><code><span style="font-family:arial,helvetica,sans-serif">convert \( font_1.gif font_2.gif font_3.gif +append \) \
\( font_4.gif font_5.gif font_6.gif +append \) \
\( font_7.gif font_8.gif font_9.gif +append \) \
\( -size 32x32 xc:none font_0.gif +append \) \
-background none -append append_array.gif</span>
</code></pre><br></div><div><br>I hope it works for you.<br><br></div><div>Good luck<br></div><div>D<br></div><div><br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Jan 27, 2017 at 5:45 PM, Millie J <span dir="ltr"><<a href="mailto:millie.jyo@gmail.com" target="_blank">millie.jyo@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<div><br><div>Is there a way to plot the Wheeler-Kiladis space-time spectra (Figs. 1 to 3), for multiple model outputs, on a single graphic plot? Thanks.</div><div>Jyothi</div><div><br></div><div><br></div><div>Jyothi Nattala</div><div>GMAO / NASA GSFC</div></div></div>
<br></div></div>______________________________<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>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>