8000 FIX: fix cleanup warnings for errorbar timeseries by ivanovmg · Pull Request #36982 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

FIX: fix cleanup warnings for errorbar timeseries #36982

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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
REF: check errorbars for list-like axes
  • Loading branch information
ivanovmg committed Oct 9, 2020
commit 198fd1eec298ab08a1c75b6e70642b2a0f462b62
18 changes: 4 additions & 14 deletions pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2706,8 +2706,6 @@ def test_errorbar_plot(self):
@pytest.mark.slow
@pytest.mark.parametrize("kind", ["line", "bar", "barh"])
def test_errorbar_plot_different_kinds(self, kind):
import matplotlib.pyplot as plt

d = {"x": np.arange(12), "y": np.arange(12, 0, -1)}
df = DataFrame(d)
d_err = {"x": np.ones(12) * 0.2, "y": np.ones(12) * 0.4}
Expand All @@ -2734,13 +2732,10 @@ def test_errorbar_plot_different_kinds(self, kind):
# UserWarning: To output multiple subplots,
# the figure containing the passed axes is being cleared
# Similar warnings were observed in GH #13188
_check_plot_works(
axes = _check_plot_works(
df.plot, yerr=df_err, xerr=df_err, subplots=True, kind=kind
)
fig = plt.gcf()
axes = fig.get_axes()
for ax in axes:
self._check_has_errorbars(ax, xerr=1, yerr=1)
self._check_has_errorbars(axes, xerr=1, yerr=1)

@pytest.mark.xfail(reason="Iterator is consumed", raises=ValueError)
@pytest.mark.slow
Expand Down Expand Up @@ -2789,8 +2784,6 @@ def test_errorbar_with_partial_columns(self):
@pytest.mark.slow
@pytest.mark.parametrize("kind", ["line", "bar", "barh"])
def test_errorbar_timeseries(self, kind):
import matplotlib.pyplot as plt

d = {"x": np.arange(12), "y": np.arange(12, 0, -1)}
d_err = {"x": np.ones(12) * 0.2, "y": np.ones(12) * 0.4}

Expand Down Expand Up @@ -2820,11 +2813,8 @@ def test_errorbar_timeseries(self, kind):
# UserWarning: To output multiple subplots,
# the figure containing the passed axes is being cleared
# Similar warnings were observed in GH #13188
_check_plot_works(tdf.plot, kind=kind, yerr=tdf_err, subplots=True)
fig = plt.gcf()
axes = fig.get_axes()
for ax in axes:
self._check_has_errorbars(ax, xerr=0, yerr=1)
axes = _check_plot_works(tdf.plot, kind=kind, yerr=tdf_err, subplots=True)
self._check_has_errorbars(axes, xerr=0, yerr=1)

def test_errorbar_asymmetrical(self):

Expand Down
0