Skip to content

BUG: bar plot can now handle bottom and left kw properly #7226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented May 24, 2014

Actually not a bug, but allows bar and barh plot to accept bottom and left kw respectively to specify the starting point.

Currently, passing bottom or left keyword results in TypeError

import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(5, 5))
df.plot(kind='bar', bottom=1, ax=axes[0])
# TypeError: bar() got multiple values for keyword argument 'bottom'

After fix

import matplotlib.pyplot as plt
fig, axes = plt.subplots(1, 2)

df = pd.DataFrame(np.random.randn(5, 5))
df.plot(kind='bar', bottom=1, ax=axes[0])

df2 = pd.DataFrame(np.random.rand(5, 5))
df2.plot(kind='barh', left=[1, 2, 3, 4, 5], stacked=True, ax=axes[1])

figure_1

@jreback jreback added this to the 0.14.1 milestone May 30, 2014
@@ -65,3 +65,4 @@ There are no experimental changes in 0.14.1
Bug Fixes
~~~~~~~~~

- Bug in ``DataFrame`` and ``Series`` bar and barh plot raises ``TypeError`` when ``bottom`` and ``left`` keyword is specified (:issue:`7226`)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe put in enhancements

@jreback
Copy link
Contributor

jreback commented May 30, 2014

@TomAugspurger pls review when you can

@TomAugspurger
Copy link
Contributor

I'm fine labeling this as a bug. **kwargs is supposed to pass along all the args of the original matplotlib function/method. left and bottom are args for bar.

@TomAugspurger
Copy link
Contributor

Merged via 4adc6fa

Thanks @sinhrks

@sinhrks sinhrks deleted the barbottom branch May 30, 2014 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants