From: Francesco M. <fra...@gm...> - 2012-07-27 08:36:23
|
Hi Andreas, 2012/7/27 Andreas Hilboll <li...@hi...>: >> Hi Andreas, >> >> 2012/7/27 Andreas Hilboll <li...@hi...>: >>> Hi, >>> >>> I'd like to place something like a 'title' inside a legend's box. In my >>> specific case, I have a legend with 5 entries, arranged in 5 columns, so >>> they're horizontally next to each other in one row. Now what I'd like to >>> have is inside the legend's box a first row (above the legend entries), >>> where I can write some text. >>> >>> Any ideas? >> >> The keyword 'title' in legend >> (http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.legend) >> should work. > > Almost embarassingly simple ... however: It looks like the title is in a > smaller font size than the other legend texts. Do I have some control > about the font size of the legend's title? Couldn't find anything in the > plt.legend docstring (I'm on 1.1.1). try: l = ax.legend( patches, labels, ..., title="legend title") t = l.get_title() #get the text object containing the title t.set_fontsize(30) #set the font size you can merge the last two lines together l.get_title().set_fontsize(30) Francesco > > Cheers, A. > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |