Axes.bar(orientation='horizontal') doesn't work?

Hi,

I'm trying to plot some horizontal bars using the .bar() method:

import matplotlib.pyplot as plt
fig=plt.figure()
ax=fig.add_subplot(1,1,1)
ax.bar([1,2,3],[4,6,5],orientation='horizontal')

raises an AssertionError:

AssertionError Traceback (most recent call last)

/home/ernest/<ipython console> in <module>()

/usr/lib/pymodules/python2.5/matplotlib/axes.py in bar(self, left, height, width, bottom, color, edgecolor, linewidth, yerr, xerr, ecolor, capsize, align, orientation, log, **kwargs)
   4230 # FIXME: convert the following to proper input validation
   4231 # raising ValueError; don't use assert for this.
-> 4232 assert len(left)==nbars, "incompatible sizes: argument 'left' must be length %d or scalar" % nbars
   4233 assert len(height)==nbars, ("incompatible sizes: argument 'height' must be length %d or scalar" %
   4234 nbars)

AssertionError: incompatible sizes: argument 'left' must be length 1 or scalar

using scalars doesn't help:

ax.bar(1,5,orientation='horizontal')

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Am I doing something wrong??

···

--
Ernest

Ernest Adrogué wrote:

Hi,

I'm trying to plot some horizontal bars using the .bar() method:

import matplotlib.pyplot as plt
fig=plt.figure()
ax=fig.add_subplot(1,1,1)
ax.bar([1,2,3],[4,6,5],orientation='horizontal')

Use

ax.barh([1,2,3], [4,5,6])

Eric