Default color for bar.
Closed this issue · 2 comments
d-cosin commented
If no color is defined when calling the bar method, it is returned the following TypeError:
lib/python2.7/site-packages/matplotlib/colors.pyc in to_rgba_array(c, alpha)
235 return result
236 # Convert one at a time.
--> 237 result = np.empty((len(c), 4), float)
238 for i, cc in enumerate(c):
239 result[i] = to_rgba(cc, alpha)
TypeError: object of type 'float' has no len()
The problem is solved if the color attribute is defined when calling the bar method. Wouldn't be the case of assigning a default color when none is specified by the user?
ResidentMario commented
Interesting. It looks to me like the behavior differs between 2.7 and 3.x
maybe. Should be easy enough to fix hopefully.
Of course the real TODO here is to write a proper test suite!
…On Nov 12, 2017 4:16 PM, "d-cosin" ***@***.***> wrote:
If no color is defined when calling the bar method, it is returned the
following TypeError:
lib/python2.7/site-packages/matplotlib/colors.pyc in to_rgba_array(c, alpha)
235 return result
236 # Convert one at a time.--> 237 result = np.empty((len(c), 4), float)
238 for i, cc in enumerate(c):
239 result[i] = to_rgba(cc, alpha)
TypeError: object of type 'float' has no len()
The problem is solved if the color attribute is defined when calling the
bar method. Wouldn't be the case of assigning a default color when none is
specified by the user?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#41>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADTkZfDuzRB_RCvFaM9ga3R7NUUGKxPvks5s12AjgaJpZM4QbC-1>
.
ResidentMario commented
This looks like a bug in the pandas.DataFrame.plot
method to me; I can no longer pass RGB tuples to it successfully? IDK what's going on there.
I've fixed this error in HEAD
(by using a named color instead), and it will go out as part of a new version of the library fairly soon. Thanks for reporting, and sorry it took so long to get to!