Can't get un-stacked bar plot in python pandas

bar-chart, pandas, python

Solution

Ok. So now I have to ask what version of pandas you're on. When I run:

from matplotlib import pyplot as plt
import pandas as pd
try:
    from io import StringIO
except:
    from StringIO import StringIO

data = StringIO("""\
                OLS     Ridge     Lasso        EN
BN         0.008935  0.013937  0.000000  0.000000
BO         0.037947  0.034341  0.021778  0.021771
BP         0.205764  0.190278  0.184766  0.179000
CB         0.302772  0.106399  0.161487  0.076948
CD         0.464572  0.378660  0.424983  0.401792
CF         0.062425  0.006078  0.000000 -0.000000
CL        -0.005794  0.002631  0.000000  0.001082
CN         0.012761  0.011331  0.010272  0.010476
""")

df = pd.read_csv(data, sep='\s+')
fig, axes = plt.subplots(nrows=2, figsize=(6, 10))
df.plot(kind='bar', stacked=False, alpha=0.4, ax=axes[0])
df.plot(kind='bar', stacked=True, alpha=0.4, ax=axes[1])
for ax in axes:
    ax.set_ylim(bottom=0)

I get:

I'm on pandas 0.13 via (ana)conda

Problem

This is weird. I just can't seem to get unstacked bar plot in python pandas (unlike pandas official guide). The bars just seem to be overlapped, instead of placed sideways. Any clue why it would be? ``` df.plot(kind='bar',stacked=False, figsize=(20,15), alpha=0.4) ``` Here is the link to the image: and here is a sample df ``` OLS Ridge Lasso EN BN 0.008935 0.013937 0.000000 0.000000 BO 0.037947 0.034341 0.021778 0.021771 BP 0.205764 0.190278 0.184766 0.179000 CB 0.302772 0.106399 0.161487 0.076948 CD 0.464572 0.378660 0.424983 0.401792 CF 0.062425 0.006078 0.000000 -0.000000 CL -0.005794 0.002631 0.000000 0.001082 CN 0.012761 0.011331 0.010272 0.010476 ```

Original source