|
From: Ted K. <ted...@gm...> - 2010-09-18 01:21:37
|
I misunderstood your question, musik. My apologies. Ted On 18 September 2010 02:15, Benjamin Root <ben...@ou...> wrote: > On Fri, Sep 17, 2010 at 1:13 PM, musik <xi....@gm...> wrote: > >> >> Is there a way to set the legend font color? I am plotting multiple sets >> of >> data using different colors. I basically want to set each legend font >> color >> the same as the corresponding data line color. Here is an example. >> >> x = arange(0,10,0.1) >> y1 = sin(x) >> y2 = cos(x) >> >> plot(x,y1,'r-',x,y2,'b--') >> >> I want the legend font for y1 to be in red and the legend font for y2 to >> be >> in blue. >> >> Can anybody help? Thanks. >> >> >> > musik, > > I am not aware of any easy way to control the font properties for each > individual item in a legend box. I would suppose that it would be possible > to obtain the list of Text objects from the legend object (*after* creating > the legend object), and then modify their color properties based on the > string that it contains. Note that I have never personally tried this. > > As far as I can tell, the text for the legend elements are black by > default. Note that you can set the font properties for all Text objects in > a legend when creating the legend with the 'prop' kwarg. > > I hope this helps, > Ben Root > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |