Skip to content

TST/BUG: _gen_two_subplots always adding subplot even with passed axis #38646

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

Merged
merged 2 commits into from
Dec 23, 2020

Conversation

mzeitlin11
Copy link
Member

  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

kwargs.get("ax", fig.add_subplot(211)) was always adding a subplot (since the argument to .get() will be evaluated even if it doesn't need to be used). Assuming the intended behavior was for fig.add_subplot(211) to be called only if ax is not passed. This change also gets rid of half of remaining matplotlib warnings from
pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_legacy

@jreback jreback added the Visualization plotting label Dec 22, 2020
@jreback
Copy link
Contributor

jreback commented Dec 22, 2020

this a user facing change? if so pls add a whatsnew (bug fix plotting in 1.3)
can you see if we have any issues open that this would close

@mzeitlin11
Copy link
Member Author

this a user facing change? if so pls add a whatsnew (bug fix plotting in 1.3)
can you see if we have any issues open that this would close

Don't think so, function is only used for testing plots (called from _check_plot_works)

@jreback jreback added this to the 1.3 milestone Dec 22, 2020
@jreback jreback merged commit 7d7880d into pandas-dev:master Dec 23, 2020
@jreback
Copy link
Contributor

jreback commented Dec 23, 2020

thanks @mzeitlin11

@mzeitlin11 mzeitlin11 deleted the tst/mpl_hist_warnings branch December 23, 2020 14:49
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants