Hello -

I got confused about specifying colors and linewidths for LineCollections.
I think it would be helpful if the docstrings explicitly state that they should be sequences.
I know, they do in some way, but it i
Maybe we should even check this on input, as the error message you get when you don't do that is confusing.

Let me explain:

from pylab import *
from matplotlib.collections import LineCollection

ax = subplot(111)
ax.add_collection( LineCollection( [[(0,0),(1,1)]], colors='r' ) )

This works fine, as apparantly colors='r' is interpreted as a sequence.
This does not work, however:

ax.add_collection( LineCollection( [[(0,0),(1,1)]], colors='r', linewidths=2 ) )

Now I get an error: TypeError: CXX: type error. That's not too helpful.
What does work is
ax.add_collection ( LineCollection( [[(0,0),(1,1)]], colors='r', linewidths=[2] ) )

Maybe the confusing part is that just specifying colors='r' works.



ps. I do all the draws as I am in interactive mode.