<div dir="ltr">Thanks Mary and David.  Mary&#39;s suggestion solved my font size issue.<div><br></div><div>I have a follow-up question I&#39;m hoping you can help me with.  I&#39;d like to make the color lines within the legend the same actual length (e.g. as measured in inches on paper) regardless of the length of the longest legend label (text).  Also, I&#39;d like to make the distance from the left edge of the legend box to the start of the lines the same physical distance, again regardless of the lengths of the legend labels.</div><div><br></div><div>What I&#39;m trying to do is to have a legend that only changes on its right side when I have longer legend labels (by having the legend box width extend only to the right to accommodate the longer label(s)).  I&#39;d like the left portion of the legend (where the lines are) to stay exactly the same in terms of the positions and physical dimensions of the various items.  </div><div><br></div><div>I modified my previous code (see attached test_legend2.ncl) to try out some cases, but I haven&#39;t been able to get things to work yet.  When I have labels that aren&#39;t too long, the legend lines are, as expected, a factor lgBoxMinorExtentF of the width of the legend box (test_legend_short_label.png), but when they are long, the legend lines get squished to some factor smaller than the specified lgBoxMinorExtentF (test_legend_long_label.png).</div><div><br></div><div>I&#39;d appreciate any suggestions on how to solve this issue.  </div><div><br></div><div>Thanks again,</div><div>Gerard</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 11:32 AM, David Brown <span dir="ltr">&lt;<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I will look into this question.<br>
 -dave<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Sep 15, 2015 at 5:20 PM, Mary Haley &lt;<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>&gt; wrote:<br>
&gt; Hi Gerard,<br>
&gt;<br>
&gt; I&#39;m hoping Dave Brown will step in and correct me if I&#39;m wrong, but I think<br>
&gt; the resizing of the legend labels is going to happen no matter what, because<br>
&gt; it&#39;s trying to fit everything inside the legend box.<br>
&gt;<br>
&gt; You can work around this by using gsn_create_legend (instead of<br>
&gt; gsn_legend_ndc) to create the legend with the same resources as before, and<br>
&gt; then use setvalues to reset the lgLabelFontHeightF resource to be what you<br>
&gt; originally wanted it to be.  Setvalues will simply change the resource value<br>
&gt; of an existing object, and the legend manager doesn&#39;t enter the picture and<br>
&gt; try to shrink your labels.<br>
&gt;<br>
&gt; It&#39;s a kludge, but I think it should work. here&#39;s what the old code looks<br>
&gt; like:<br>
&gt;<br>
&gt;   gsn_legend_ndc(wks_png, num_curves, legend_labels, 0.20, 0.35, lgres)<br>
&gt;   frame(wks_png)<br>
&gt;<br>
&gt; And here&#39;s what the new code should look like:<br>
&gt;<br>
&gt;  ;---gsn_create_legend creates the legend, but doesn&#39;t draw it<br>
&gt;   legend_id = gsn_create_legend(wks_png, num_curves, legend_labels, lgres)<br>
&gt;<br>
&gt; ;---Reset lgLabelFontHeightF to the desired value<br>
&gt;   setvalues legend_id<br>
&gt;     &quot;lgLabelFontHeightF&quot; : lgres@lgLabelFontHeightF<br>
&gt;   end setvalues<br>
&gt;<br>
&gt; ;--Now draw the legend<br>
&gt;   draw(legend_id)<br>
&gt;   frame(wks_png)<br>
&gt;<br>
&gt; You may need to place with lgres@vpXF and legres@vpYF to position the legend<br>
&gt; as desired.<br>
&gt;<br>
&gt; --Mary<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Sep 14, 2015 at 11:19 PM, Gerard Ketefian - NOAA Affiliate<br>
&gt; &lt;<a href="mailto:gerard.ketefian@noaa.gov">gerard.ketefian@noaa.gov</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;d like to generate a legend in which the font size of the item labels is<br>
&gt;&gt; the same regardless of the length (i.e. the number of characters) of the<br>
&gt;&gt; item labels.  I&#39;m using gsn_legend_ndc(...) to add the legend to my plot.<br>
&gt;&gt;<br>
&gt;&gt; The problem I&#39;m having is that NCL is adjusting the font size (I suppose<br>
&gt;&gt; to always fit the labels within the width of the legend box), and I&#39;m not<br>
&gt;&gt; getting the font size that I&#39;d like.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve attached an NCL script (test_legend.ncl) that generates png files<br>
&gt;&gt; showing what happens when:<br>
&gt;&gt;<br>
&gt;&gt; 1) No adjustments are made to any legend resources (case of manual_manage<br>
&gt;&gt; set to False in the script).  I tried a case of short legend labels<br>
&gt;&gt; (test_legend_autoManage_short_labels.png) and another with long ones<br>
&gt;&gt; (test_legend_autoManage_long_labels.png).  You can see that NCL adjusts the<br>
&gt;&gt; font size, I suppose to fit it within the legend box width.<br>
&gt;&gt;<br>
&gt;&gt; 2) Adjustments are made to several legend resources, including setting<br>
&gt;&gt; lgAutoManage to False (case of manual_manage set to False in the script) and<br>
&gt;&gt; setting a specific value for lgLabelFontHeightF.  According to the online<br>
&gt;&gt; documentation, in this case NCL should not adjust the font size, and I<br>
&gt;&gt; should get whatever font size I specified via lgLabelFontHeightF.  Again I<br>
&gt;&gt; tried a case of both short (test_legend_manualManage_short_labels.png) and<br>
&gt;&gt; long (test_legend_manualManage_long_labels.png) legend labels.  You can see<br>
&gt;&gt; that again, NCL adjusted the font size.<br>
&gt;&gt;<br>
&gt;&gt; Any idea how I can make NCL use the font size I specified, without any<br>
&gt;&gt; automatic adjustments?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Gerard<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; ncl-talk mailing list<br>
&gt;&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt;&gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
</div></div></blockquote></div><br></div>