<div dir="ltr">Hi Giorgio,<div>You can try setting lbLabelAlignment to "ExternalEdges" which I believe will produce the same results as cnLabelBarEndStyle. See example #14 here:</div><div><a href="https://www.ncl.ucar.edu/Applications/labelbar.shtml#ex14">https://www.ncl.ucar.edu/Applications/labelbar.shtml#ex14<br></a></div><div>Or see many other examples where this resource is set:</div><div><a href="https://www.ncl.ucar.edu/Applications/res_list.shtml#lbLabelAlignment">https://www.ncl.ucar.edu/Applications/res_list.shtml#lbLabelAlignment</a><br><br></div><div>Hope that helps!</div><div>Adam</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 28, 2022 at 1:22 PM Giorgio Graffino via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p style="font-size:12pt;font-family:Arial"><span style="font-family:Arial;font-size:12pt">Dear NCL Community,</span></p><p style="font-size:12pt;font-family:Arial"><span style="font-family:Arial;font-size:12pt"><br></span></p><p style="font-size:12pt;font-family:Arial"><span style="font-family:Arial;font-size:12pt">I'm trying to set the resource </span><span style="font-size:12pt;font-family:Arial">cnLabelBarEndStyle to "</span><span style="font-size:12pt;font-family:Arial">ExcludeOuterBoxes</span><span style="font-size:12pt;font-family:Arial">" while calling </span><span style="font-size:12pt;font-family:Arial">gsn_create_labelbar, to get ride of the labelbar boxes bigger than 1 and smaller than -1 in the attached plot. However, since I'm not drawing a contour plot, the resource doesn't do anything. I'm adapting this example (</span><span style="font-size:12pt;font-family:Arial"><a href="https://www.ncl.ucar.edu/Applications/Scripts/table_8.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/table_8.ncl</a></span><span style="font-size:12pt;font-family:Arial">). The procedure drawing the labelbar is shown below. </span></p><p style="font-size:12pt;font-family:Arial"><span style="font-size:12pt;font-family:Arial"><br></span></p><p style="font-size:12pt;font-family:Arial"><span style="font-size:12pt;font-family:Arial">How can I solve the issue? I tried to look for a solution in the quick search bar in </span><span style="font-family:arial,sans-serif;font-size:12pt"><a href="https://www.ncl.ucar.edu/Support/posting_guidelines.shtml" target="_blank">https://www.ncl.ucar.edu/Support/posting_guidelines.shtml</a>, but it's always giving me the following error "</span><span style="font-family:arial,sans-serif;font-size:12pt">The requested page could not be found.</span><span style="font-family:arial,sans-serif;font-size:12pt">"</span></p><p style="font-size:12pt;font-family:Arial"><span style="font-family:arial,sans-serif;font-size:12pt"><br></span></p><p style="font-size:12pt;font-family:Arial"><span style="font-family:arial,sans-serif;font-size:12pt">Cheers,</span></p><p style="font-size:12pt;font-family:Arial"><span style="font-family:arial,sans-serif;font-size:12pt">Giorgio</span></p><p style="font-size:12pt;font-family:Arial"><span style="font-size:12pt;font-family:Arial"><br></span></p><p><span style="font-family:Arial;font-size:12pt">undef("add_labelbar")</span></p><p><span style="font-family:Arial;font-size:12pt">procedure add_labelbar(wks,plot,cmap,labels,stride,title,location)</span></p><p><span style="font-family:Arial;font-size:12pt">local nboxes, vph, vpw, nboxes, lbres, lbid, amres, annoid</span></p><p><span style="font-family:Arial;font-size:12pt">begin</span></p><p><span style="font-family:Arial;font-size:12pt"> nboxes = dimsizes(labels)+1 </span></p><p><span style="font-family:Arial;font-size:12pt"> colors = span_color_rgba(cmap,nboxes)</span></p><p><span style="font-family:Arial;font-size:12pt"> getvalues plot ; Get plot size for use in</span></p><p><span style="font-family:Arial;font-size:12pt"> "vpHeightF" : vph ; creating labelbar.</span></p><p><span style="font-family:Arial;font-size:12pt"> "vpWidthF" : vpw</span></p><p><span style="font-family:Arial;font-size:12pt"> end getvalues</span></p><p><span style="font-family:Arial;font-size:12pt">;</span></p><p><span style="font-family:Arial;font-size:12pt">; Set some resources for a vertical or horizontal labelbar on the</span></p><p><span style="font-family:Arial;font-size:12pt">; bottom or right axis. </span></p><p><span style="font-family:Arial;font-size:12pt">;</span></p><p><span style="font-family:Arial;font-size:12pt">; am_para/am_orth</span></p><p><span style="font-family:Arial;font-size:12pt">; 0.0/ 0.0 - annotation in dead center of plot</span></p><p><span style="font-family:Arial;font-size:12pt">; 0.5/ 0.5 - annotation at bottom right of plot</span></p><p><span style="font-family:Arial;font-size:12pt">; 0.5/-0.5 - annotation at top right of plot</span></p><p><span style="font-family:Arial;font-size:12pt">; -0.5/-0.5 - annotation at top left of plot</span></p><p><span style="font-family:Arial;font-size:12pt">; -0.5/ 0.5 - annotation at bottom left of plot</span></p><p><span style="font-family:Arial;font-size:12pt">; </span></p><p><span style="font-family:Arial;font-size:12pt">; You will likely need to modify the am_para/am_orth </span></p><p><span style="font-family:Arial;font-size:12pt">; values depending on your X and Y axis labels, the size</span></p><p><span style="font-family:Arial;font-size:12pt">; of your plot, the number of rows and columns you have, et.</span></p><p><span style="font-family:Arial;font-size:12pt">;</span></p><p><span style="font-family:Arial;font-size:12pt"> if(any(location.eq.(/"bot1","bot2"/))) then</span></p><p><span style="font-family:Arial;font-size:12pt"> orient = "horizontal" </span></p><p><span style="font-family:Arial;font-size:12pt"> width = vpw * 0.95 ; slightly shorter than width of plot</span></p><p><span style="font-family:Arial;font-size:12pt"> height = vph * 0.15</span></p><p><span style="font-family:Arial;font-size:12pt"> am_just = "BottomCenter"</span></p><p><span style="font-family:Arial;font-size:12pt"> am_para = 0.0 ; Centered about X axis</span></p><p><span style="font-family:Arial;font-size:12pt"> title_pos = "Top"</span></p><p><span style="font-family:Arial;font-size:12pt"> if(location.eq."bot1")</span></p><p><span style="font-family:Arial;font-size:12pt"> am_orth = 0.85 ; Move labelbar down</span></p><p><span style="font-family:Arial;font-size:12pt"> else</span></p><p><span style="font-family:Arial;font-size:12pt"> am_orth = 1.04 ; move further down</span></p><p><span style="font-family:Arial;font-size:12pt"> end if </span></p><p><span style="font-family:Arial;font-size:12pt"> else</span></p><p><span style="font-family:Arial;font-size:12pt"> orient = "vertical"</span></p><p><span style="font-family:Arial;font-size:12pt"> width = vpw * 0.15</span></p><p><span style="font-family:Arial;font-size:12pt"> height = vph * 0.95 ; slightly shorter than height of plot</span></p><p><span style="font-family:Arial;font-size:12pt"> am_just = "TopLeft"</span></p><p><span style="font-family:Arial;font-size:12pt"> am_orth = -0.5 ; Move labelbar up</span></p><p><span style="font-family:Arial;font-size:12pt"> title_pos = "Left"</span></p><p><span style="font-family:Arial;font-size:12pt"> if(location.eq."rgt2")</span></p><p><span style="font-family:Arial;font-size:12pt"> am_para = 0.55 ; Move labelbar right</span></p><p><span style="font-family:Arial;font-size:12pt"> else</span></p><p><span style="font-family:Arial;font-size:12pt"> am_para = 0.78 ; move further right</span></p><p><span style="font-family:Arial;font-size:12pt"> end if </span></p><p><span style="font-family:Arial;font-size:12pt"> end if</span></p><p><span style="font-family:Arial;font-size:12pt">; labelbar resources</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres = True </span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbAutoManage = False ; Necessary to control sizes</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@vpWidthF = width</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@vpHeightF = height</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@cnLabelBarEndStyle = "ExcludeOuterBoxes"</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbFillColors = colors ; labelbar colors</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbMonoFillPattern = True ; Solid fill pattern</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbLabelFontHeightF = 0.015 ; font height. Default is small</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbLabelAlignment = "InteriorEdges"</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbOrientation = orient</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbTitleString = title</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbPerimOn = False</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbTitlePosition = title_pos</span></p><p><span style="font-family:Arial;font-size:12pt"> lbres@lbLabelStride = stride</span></p><p><span style="font-family:Arial;font-size:12pt"> lbid = gsn_create_labelbar(wks,nboxes,labels,lbres)</span></p><p><span style="font-family:Arial;font-size:12pt">; annotation resources</span></p><p><span style="font-family:Arial;font-size:12pt"> amres = True</span></p><p><span style="font-family:Arial;font-size:12pt"> amres@amJust = am_just</span></p><p><span style="font-family:Arial;font-size:12pt"> amres@amOrthogonalPosF = am_orth</span></p><p><span style="font-family:Arial;font-size:12pt"> amres@amParallelPosF = am_para</span></p><p><span style="font-family:Arial;font-size:12pt">; attach the labelbar to the plot</span></p><p><span style="font-family:Arial;font-size:12pt"> plot@annoid = gsn_add_annotation(plot,lbid,amres)</span></p><p><span style="font-family:Arial;font-size:12pt">end</span></p>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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 IV, Climate Analysis Section</font></span></div><div><span><font color="#888888">Climate and Global Dynamics Laboratory<br></font></span></div></div><div><span style="color:rgb(136,136,136)">National Center for Atmospheric Research</span><span><font color="#888888"><br></font></span></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></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>