wesm/pandas — Issue #702: Bar plot fails if an axis parameter is supplied
Author: elpres
Created: 2012-01-27 16:01:25+00:00
State: open

Example code:

from pandas import DataFrame
import matplotlib.pyplot as plt

df = DataFrame({'a': [0, 1], 'b': [1, 0]})

fig = plt.figure()
ax = fig.add_subplot(111)
df.plot(ax=ax, kind='bar')
plt.show()

UnboundLocalError: local variable 'axes' referenced before assignment

If the 'ax' parameter is removed, no problem. Line plots with a custom 'ax' work though.