matlab style grouped bar charts

Hi,

Is there anything like the matlab bar function implemented which
automatically plots groups of bars? Ie bar(x,y) where x.shape = (m,)
and y.shape =(m,n) or similar...
In Matlab this would draw M groups of N vertical bars, colored appropriately.

I can't get bar to do this and didn't find anything in the
documentation - unfortunately I wasn't able to search the mailing list
since sourceforge was playing up.

Thanks,

Robin

Hi,

I'm still curious to know if theres any convenience functions to do
this type of bar plotting. Also I've come to rely on the 'stacked'
option of MATLAB's bar command - is it possible to get that effect in
matplotlib?

Here is an example of what I'd like to be able to do:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/bar2.gif

Thanks,

Robin

···

On Mon, Apr 21, 2008 at 5:09 PM, Robin <robince@...287...> wrote:

Hi,

Is there anything like the matlab bar function implemented which
automatically plots groups of bars? Ie bar(x,y) where x.shape = (m,)
and y.shape =(m,n) or similar...
In Matlab this would draw M groups of N vertical bars, colored appropriately.

I can't get bar to do this and didn't find anything in the
documentation - unfortunately I wasn't able to search the mailing list
since sourceforge was playing up.

Thanks,

Robin

Take a look at the stacked bar demo:

http://matplotlib.sourceforge.net/examples/bar_stacked.py

for stacked bar charts. We do not currently have any helper functions
for the side-by-side comparisons, so you have to provide the offsets
yourself, as in

http://matplotlib.sourceforge.net/examples/barchart_demo.py

though such functionality would certainly be useful.

JDH

···

On Mon, Apr 28, 2008 at 4:44 AM, Robin <robince@...287...> wrote:

I'm still curious to know if theres any convenience functions to do
this type of bar plotting. Also I've come to rely on the 'stacked'
option of MATLAB's bar command - is it possible to get that effect in
matplotlib?

Here is an example of what I'd like to be able to do:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/bar2.gif