<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Adam</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Glad you found the solution. Basically, once you overlay a plot on top of another, you can't overlay that plot on somebody else. So, yes, you have to create multiple copies of the same plot, if you need to overlay it multiple times.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">By the way, you can use a "list" to delete a bunch of things at once. A list is denoted with [/ and /]:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">delete([/tmp1,tmp3,tmp5/])</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 Mon, Aug 8, 2016 at 3:36 AM, Adam Herrington <span dir="ltr"><<a href="mailto:adam.herrington@stonybrook.edu" target="_blank">adam.herrington@stonybrook.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">I found a work around to the problem - calling gsn_csm_contour for each overlay. I think it works because it assigns a unique plot id to each overlay. The revision new order looks like:<div><br></div><div><span class=""><div> res2@cnFillOn = False</div><div> res2@cnLinesOn = True</div><div> res2@cnLineThicknessF = 2.</div></span><div> res2@<wbr>gsnContourNegLineDashPattern = 1</div><div> res@<wbr>gsnContourZeroLineThicknessF = 3.</div><span class=""><div> res2@cnLevelSelectionMode = "ManualLevels"</div><div> res2@cnLevelSpacingF = 5.e10;</div><div> tmp0 = gsn_csm_contour(wks,psi1,res2)</div><div><br></div></span><div> tmp2 = gsn_csm_contour(wks,psi1,res2)</div><div> tmp4 = gsn_csm_contour(wks,psi1,res2)</div><div> overlay(plot(0),tmp0)</div><div> overlay(plot(2),tmp2)</div><div> overlay(plot(4),tmp4)</div><div> delete(tmp0)</div><div> delete(tmp2)</div><div> delete(tmp4)</div><span class=""><div><br></div><div> res2@cnLevelSpacingF = 1.e10</div><div> tmp1 = gsn_csm_contour(wks,dpsi,res2)</div><div><br></div></span><div> tmp3 = gsn_csm_contour(wks,dpsi,res2)</div><div> tmp5 = gsn_csm_contour(wks,dpsi,res2)</div><div> overlay(plot(1),tmp1)</div><div> overlay(plot(3),tmp3)</div><div> overlay(plot(5),tmp5)</div><div> delete(tmp1)</div><div> delete(tmp3)</div><div> delete(tmp5)</div></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 7, 2016 at 1:14 PM, Adam Herrington <span dir="ltr"><<a href="mailto:adam.herrington@stonybrook.edu" target="_blank">adam.herrington@stonybrook.<wbr>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>Hi all,</div><div><br></div><div>I am struggling with overlaying a single contour plot (called 'tmp0' below) over multiple plots in a panel. The script below results in the error "fatal:NhlAddOverlay: tranform is already an annotation or overlay..."</div><div><br></div><div><div> plot(1) = gsn_csm_contour(wks,dz_m,res1)</div><div> plot(3) = gsn_csm_contour(wks,dy_m,res1)</div><div> res1@tiXAxisString = "Latitude"</div><div> plot(5) = gsn_csm_contour(wks,dy_e,res1)</div><div> delete(res1@tiXAxisString)</div><div><br></div><div> res2@cnFillOn = False</div><div> res2@cnLinesOn = True</div><div> res2@cnLineThicknessF = 2.</div><div> res2@cnLevelSelectionMode = "ManualLevels"</div><div> res2@cnLevelSpacingF = 5.e10;</div><div> tmp0 = gsn_csm_contour(wks,psi1,res2)</div><div><br></div><div> res2@cnLevelSpacingF = 1.e10</div><div> tmp1 = gsn_csm_contour(wks,dpsi,res2)</div><div><br></div><div> overlay(plot(0),tmp0)</div><div> overlay(plot(2),tmp0) ;<-fatal:NhlAddOverlay</div><div> overlay(plot(4),tmp0) ;<-fatal:NhlAddOverlay</div><div> overlay(plot(1),tmp1)</div><div> overlay(plot(3),tmp1) ;<-fatal:NhlAddOverlay</div><div> overlay(plot(5),tmp1) ;<-fatal:NhlAddOverlay</div></div><div>...<br></div><div> gsn_panel(wks,plot,(/3,2/),res<wbr>P)<br></div><div><br></div><div>In terms of finding a solution, I would prefer to keep all the overlays contained in the graphics variable 'plot' so that I can easily perform a panel plot. I don't think the solution provided by Mary Haley in <a href="https://www.ncl.ucar.edu/Support/talk_archives/2013/3802.html" target="_blank">https://www.ncl.ucar.edu/Su<wbr>pport/talk_archives/2013/3802.<wbr>html</a> would work for me, since gsn_panel draws all the plots at once.<br></div><div><br></div><div>Any help is greatly appreciated!</div><span><font color="#888888"><div><br></div><div>Adam</div><div><br></div><div><br></div><div><br></div></font></span></div>
</blockquote></div><br></div>
</div></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>