I'm getting an error from barh (Matplotlib version
0.87.2.win32-py2.4). Could someone tell me how it can be fixed without
fiddling around with matplotlib source?:
from matplotlib import *
colours = ['lemonchiffon', 'lightskyblue', 'indianred']
x = [170.804, 186.838, 217.725]
y = arange(3)+.5 # the bar centers on the y axis
barh(x,y, color=colours)
yticks(y, ('A', 'B', 'C'))
show()
Traceback (most recent call last):
File "C:\temp\wmaProBarh\wmaProBarh.py", line 9, in ?
barh(x,y, color=colours)
File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 1661, in barh
ret = gca().barh(*args, **kwargs)
File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 1238, in barh
if (is_string_like(color) or
TypeError: len() of unsized object
···
--------------
But the scripts works in this case:
from matplotlib import *
colours = ['lemonchiffon', 'lightskyblue', 'indianred', 'palegreen']
x = [170.804, 186.838, 217.725, 100]
y = arange(4)+.5 # the bar centers on the y axis
barh(x,y, color=colours)
yticks(y, ('A', 'B', 'C', 'D'))
show()