Skip to content

Commit

Permalink
Fixed issue with plotting a column with all null values.
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-thakral committed Oct 18, 2011
1 parent c375fa3 commit 8264a12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2860,12 +2860,14 @@ def plot(self, subplots=False, sharex=True, sharey=False, use_index=True,
x = range(len(self))

for i, col in enumerate(_try_sort(self.columns)):
empty = np.all(np.isnan(self[col].values))
y = self[col].values if not empty else np.zeros(x.shape)
if subplots:
ax = axes[i]
ax.plot(x, self[col].values, 'k', label=col, **kwds)
ax.plot(x, y, 'k', label=col, **kwds)
ax.legend(loc='best')
else:
ax.plot(x, self[col].values, label=col, **kwds)
ax.plot(x, y, label=col, **kwds)

ax.grid(grid)

Expand Down

1 comment on commit 8264a12

@aman-thakral
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed #251

Please sign in to comment.