[ncl-talk] legend font size

Gerard Ketefian - NOAA Affiliate gerard.ketefian at noaa.gov
Mon Sep 14 22:19:00 MDT 2015


Hi,

I'd like to generate a legend in which the font size of the item labels is
the same regardless of the length (i.e. the number of characters) of the
item labels.  I'm using gsn_legend_ndc(...) to add the legend to my plot.

The problem I'm having is that NCL is adjusting the font size (I suppose to
always fit the labels within the width of the legend box), and I'm not
getting the font size that I'd like.

I've attached an NCL script (test_legend.ncl) that generates png files
showing what happens when:

1) No adjustments are made to any legend resources (case of manual_manage
set to False in the script).  I tried a case of short legend labels
(test_legend_autoManage_short_labels.png) and another with long ones
(test_legend_autoManage_long_labels.png).  You can see that NCL adjusts the
font size, I suppose to fit it within the legend box width.

2) Adjustments are made to several legend resources, including setting
lgAutoManage to False (case of manual_manage set to False in the script)
and setting a specific value for lgLabelFontHeightF.  According to the
online documentation, in this case NCL should not adjust the font size, and
I should get whatever font size I specified via lgLabelFontHeightF.  Again
I tried a case of both short (test_legend_manualManage_short_labels.png)
and long (test_legend_manualManage_long_labels.png) legend labels.  You can
see that again, NCL adjusted the font size.

Any idea how I can make NCL use the font size I specified, without any
automatic adjustments?

Thanks,
Gerard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150914/67f93c8d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_legend.ncl
Type: application/octet-stream
Size: 7286 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150914/67f93c8d/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_legend_autoManage_short_labels.png
Type: image/png
Size: 81061 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150914/67f93c8d/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_legend_autoManage_long_labels.png
Type: image/png
Size: 80763 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150914/67f93c8d/attachment-0005.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_legend_manualManage_short_labels.png
Type: image/png
Size: 85165 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150914/67f93c8d/attachment-0006.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_legend_manualManage_long_labels.png
Type: image/png
Size: 95249 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150914/67f93c8d/attachment-0007.png 


More information about the ncl-talk mailing list