From: John H. <jdh...@ac...> - 2004-11-26 16:43:16
|
>>>>> "Daniel" == Daniel Newton <da...@ne...> writes: Daniel> Hi, I am trying to make a legend transparent (using Daniel> GTKAgg) as sometimes it is quite big an obscures part of Daniel> my graphs. Daniel> I have tryed this with no luck: l = figure.legend(lines, Daniel> names, legend) l.set_alpha(.5) Daniel> is this possible? Is it the entire legend you want to make transparent, or simply the rectangular background? For the latter, you need to set the alpha on the legend "frame". You have two options here leg = legend(blah, blah) leg.draw_frame(False) # turn it off entirely or frame = leg.get_frame() frame.set_alpha(0.5) # make it semi-transparent See http://matplotlib.sf.net/examples/legend_demo.py for an example of getting handles to all the lines, patches and texts in the legend, whose properties you can set independently. There has been a discussion on whether it would be desirable for a set call on an object to propagate to all the objects it contains. Ie, would it be a good thing to be able to do set(leg, alpha=0.5) and have this propogate to the legend frame, lones, patches, and text instances. Or is the current setup where you control each of these objects independently preferable? JDH |