On Fri, Oct 22, 2010 at 6:26 AM, Jae-Joon Lee <lee.j.j...@gmail.com> wrote: > On Thu, Oct 21, 2010 at 4:31 AM, Gökhan Sever <gokhanse...@gmail.com> wrote: >> How could I change the appearance of the legend symbol in this case? >> It auto-uses a patch object (rectangle in this case). >> I would like to get a straight line instead. > > You may use proxy artists. > > http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist > > Regards, > > -JJ >
Thanks for the suggestion JJ. I have actually changed my initial approach. Now I am just using colored text to create pseudo-legends, like shown below: ax1.text(0.40, 0.8, "Cloud-base", fontsize=14, transform=ax1.transAxes) ax1.text(0.40, 0.7, "BallVario", fontsize=14, color='b', transform=ax1.transAxes) ax1.text(0.40, 0.6, "AIMMS", fontsize=14, color='g', transform=ax1.transAxes) By the way, from the linked construct, changing width and height of the rectangle doesn't have any affect. p = Rectangle((0, 0), 1, 1, fc="r") legend([p], ["Red Rectangle"]) p = Rectangle((0, 0), 10.0, 2.0, fc="r") plt.legend([p], ["Red Rectangle"]) or making trying a smaller rectangle: p = Rectangle((0, 0), 0.2, 1, fc="r") plt.figure(); plt.legend([p], ["Red Rectangle"]) -- Gökhan ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users