On 08/22/2010 04:51 AM, Daπid wrote: > On Sat, Aug 14, 2010 at 10:19 PM, Eric Firing<efir...@hawaii.edu> wrote: >> The problem is that the "alpha" kwarg can never be other than a scalar >> in mpl at present, as far as I know. The error message from to_rgba was >> intended to be informative, but in this case it is misleading. > > Thanks for your response. I was following the logic for colors, which > does accept lists.
That was a reasonable thing to do, but unfortunately, for historical reasons, there are inconsistencies and ambiguities associates with the alpha kwarg in mpl. > > Anyway, the error message is diferent if I set the color or not, which > is not logical. Granted. This is one of many situations in which the error message is not very informative. We don't have a consistent policy for validating kwargs, so invalid values can filter down into the depths of the code before they trigger an exception. > > By the way, do you have any clue on the persistence of the problem > until the IDLE is restarted? I mean, even with the code fixed, the > error is still raised until IDLE is reopened. > If you are fixing code that is in a module that has been imported, IDLE may be using the old code, not the new. This is inherent in python--importing a module that has already been imported does not rerun the code in that module, or change any existing objects. There are ways of getting around this, at least with respect to function and class definitions, but usually it is easier, surer, and cleaner to restart the python interpreter so that everything is clearly using the new code. Eric > > Thank you again, > > David. ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users