From: John H. <jdh...@ac...> - 2004-04-30 11:47:10
|
>>>>> "Jon" == Jon Peirce <Jon...@no...> writes: Jon> Hi there! I've been using the legend function in a plot but Jon> can't get the location setting to work. I've tried the Jon> numeric and string versions of the location codes and tried Jon> several backends (but only winXP, python 2.3.3). The legend Jon> always appears upper-right. Jon> Is this functionality platform-dependent? No, in the 2 arg version legend(LABELS, LOC), the loc argument must be a position arg, not be a kwarg. Ie, plots.legend( ('test', ), 4) works. Note that the labels argument needs to be a list or tuple, not a string as you gave, but this is not related to your problem. The problem you experienced was due to the inadequate way I was using introspection to determine which of the many call signatures legend has. There is an easy fix which gets it right in the case where loc is a kwarg. In axes.Aces.legend, replace loc = 1 with loc = kwargs.get('loc', 1) as the first line after the doc string. Hope this helps, JDH |