From: Jeff L. <lay...@at...> - 2011-02-11 12:21:22
|
On 02/11/2011 03:48 AM, Jae-Joon Lee wrote: > On Fri, Feb 11, 2011 at 8:38 AM, Jeff Layton<lay...@at...> wrote: >> I hate to be the first one to comment on this post but I forgot to give >> the error message and version of matplotlib. The error is, >> >> Traceback (most recent call last): >> File "./multi_file_test_2.py", line 460, in<module> >> ax.legend( (p1[0], p2[0]), ('IO Time', 'Total Elapsed Time'), >> bbox_to_anchor=(1.05, 1), loc=2); >> File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line >> 3617, in legend >> self.legend_ = mlegend.Legend(self, handles, labels, **kwargs) >> TypeError: __init__() got an unexpected keyword argument 'bbox_to_anchor' >> >> >> The version of matplotlib I'm using is, 0.98.3-4ubuntu1 >> >> Jeff >> > I'm quite sure that the *bbox_to_anchor* parameter is introduced later > than 0.98. > I think you have a few options, > > * use "loc" parameter. > * see if "figlegend" helps. > * create a empty axes just for the purpose of drawing the legend. > * upgrade to 1.0.1 and I highly recommend it if you can. > > Regards, > > -JJ I was worried about that. I will try to update my system but it's an old Ubuntu 8.10 system. Looks like I have an excuse to upgrade Ubuntu :) Thanks! Jeff |