<div dir="ltr">Hi Marston,<div>simple_legend should be called before draw/frame are invoked. Thus, unless you are setting gsnDraw/gsnFrame = False in your panel resource list, simple_legend should be called before gsn_panel.</div><div>Adam </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 10:13 AM, Marston Johnston <span dir="ltr"><<a href="mailto:shejo284@gmail.com" target="_blank">shejo284@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="white" lang="EN-GB" link="blue" vlink="purple"><div class="m_4671758661419378566WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Hi Mary,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Thanks for the response. I think I’ll try Adam’s example but I was wondering if I’m using a panel plot, do I do this after the<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Panel plot command?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Best,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">/M<u></u><u></u></span></p><div><p class="MsoNormal"><span style="color:#0070c0">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">Marston S. Johnston, PhD<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">Department of Earth Sciences<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">University of Gothenburg, Sweden<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">Email: <a href="mailto:marston.johnston@gu.se" target="_blank"><span style="color:#0070c0">marston.johnston@gu.se</span></a><u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">SkypeID: marston.johnston <u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">Phone: <a href="tel:+46%2031%20786%2049%2001" value="+46317864901" target="_blank">+46-31-7864901</a> <u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">Only the fruitful thing is true!<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#0070c0">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<u></u><u></u></span></p></div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span></b><span style="font-family:Calibri;color:black">Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>><br><b>Date: </b>Monday, 12 June 2017 at 16:53<br><b>To: </b>Marston Johnston <<a href="mailto:shejo284@gmail.com" target="_blank">shejo284@gmail.com</a>><br><b>Cc: </b>NCL Talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br><b>Subject: </b>Re: [ncl-talk] legend colorfil problem<u></u><u></u></span></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div><p class="MsoNormal">Hi Marston,<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">There are two things you can try.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">One is to use the new simple_legend function that Adam Phillips added. See examples leg_16.ncl and leg_17.ncl at:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><a href="http://www.ncl.ucar.edu/Applications/legend.shtml#ex16" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/legend.shtml#ex16</a><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The second is I can give you a beta version of 6.5.0 that has the tmGridDrawOrder resource. This allows you to make the grid lines draw in an earlier phase than the legend. See example leg_18.ncl on the same page.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">--Mary<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Sat, Jun 10, 2017 at 7:40 AM, Marston Johnston <<a href="mailto:shejo284@gmail.com" target="_blank">shejo284@gmail.com</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"><span style="font-size:11.0pt">Hi,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">I’m trying to get the legend on a xy plot to not show the gridlines by adding the following:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">lgres@lgPerimFillColor = "yellow"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">lgres@lgPerimFill = "SolidFill"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">I’m doing this inside gsn_legend_ndc because I want the legend on plot(3) only:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres = True</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgLineColors = (/"blue","black","red","blue",<wbr>"black","red"/)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@vpWidthF = 0.15 ; width of legend (NDC)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@vpHeightF = 0.1 ; height of legend (NDC)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgDashIndexes = (/0,0,0,2,2,2/) ; dash indexes</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@LgLineThicknessF = 2.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgPerimFillColor = "yellow"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgPerimFill = "SolidFill"</span><u></u><u></u></p><p class="MsoNormal"><span lang="SV" style="font-size:11.0pt"> gsn_legend_ndc(wks,6,(/"MCH1",<wbr>"MCH2","MCH3","OCH1","OCH2","<wbr>OCH3"/),0.6,0.2,lgres)</span><u></u><u></u></p><p class="MsoNormal"><span lang="SV" style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">I can change the background color but the ”SolidFill” doesn’t seem to work. I’m calling gsn_legend_ndc before the </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">gsn_panel. Is this an issue where the plot is being added after the legend? I’ve looked at the tmGridDrawOrder but this doesn’t seem to work for gridlines in a xy plot. </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">I’m using NCL version 6.4. Here’s the entire plot sequence:</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res = True</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@gsnDraw = False</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@gsnFrame = False</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@tmXMajorGrid = True</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@tmXMajorGridThicknessF = 1.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@<wbr>tmXMajorGridLineDashPattern = 2</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@tmYMajorGrid = True</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@tmYMajorGridThicknessF = 1.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@<wbr>tmYMajorGridLineDashPattern = 2</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@xyLineColors = (/"blue","black","red","blue",<wbr>"black","red"/)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@xyLineThicknesses = (/1,1,1,1,1,1/)*2</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@xyDashPatterns = (/0,0,0,2,2,2/)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> ;res@tiYAxisString = "~F8~T~B~B~N~ (K)"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@vpHeightF = 0.5</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@vpWidthF = 1.5</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@trXMinF = -90.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@trXMaxF = 90.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@trYMinF = 230.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@trYMaxF = 280.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> plot(0) = gsn_csm_xy(wks,zmas&lat,<wbr>dataas,res)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> plot(1) = gsn_csm_xy(wks,zmas&lat,<wbr>datacs,res)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@trYMinF = -4.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@trYMaxF = 0.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> res@tiXAxisString = "Latitude"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> plot(2) = gsn_csm_xy(wks,zmas&lat,<wbr>datace,res)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres = True</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgLineColors = (/"blue","black","red","blue",<wbr>"black","red"/)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@vpWidthF = 0.15 ; width of legend (NDC)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@vpHeightF = 0.1 ; height of legend (NDC)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgDashIndexes = (/0,0,0,2,2,2/) ; dash indexes</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@LgLineThicknessF = 2.0</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgPerimFillColor = "yellow"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> lgres@lgPerimFill = "SolidFill"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><span lang="SV" style="font-size:11.0pt">gsn_legend_ndc(wks,6,(/"MCH1",<wbr>"MCH2","MCH3","OCH1","OCH2","<wbr>OCH3"/),0.6,0.2,lgres)</span><u></u><u></u></p><p class="MsoNormal"><span lang="SV" style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span lang="SV" style="font-size:11.0pt"> </span><span style="font-size:11.0pt">resP = True</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> resP@gsnMaximize = True</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> resP@gsnPanelFigureStrings = str_upper((/"a","b","c"/))</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> resP@<wbr>gsnPanelFigureStringsFontHeigh<wbr>tF = 0.01</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> resP@amJust = "TopLeft"</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> resP@gsnPanelBottom = 0.05</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> gsn_panel(wks,plot,(/3,1/),<wbr>resP)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">Thanks for your advice/help with this,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt">/M</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt"> </span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">Marston S. Johnston, PhD</span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">Department of Earth Sciences</span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">University of Gothenburg, Sweden</span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">Email: <a href="mailto:marston.johnston@gu.se" target="_blank"><span style="color:#0070c0">marston.johnston@gu.se</span></a></span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">SkypeID: marston.johnston </span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">Phone: <a href="tel:+46%2031%20786%2049%2001" target="_blank">+46-31-7864901</a> </span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">Only the fruitful thing is true!</span><u></u><u></u></p><p class="MsoNormal"><span style="color:#0070c0">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><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" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>