Skip to content

Fix matplotlib warnings #18306

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
TomAugspurger opened this issue Nov 15, 2017 · 2 comments · Fixed by #38659
Closed

Fix matplotlib warnings #18306

TomAugspurger opened this issue Nov 15, 2017 · 2 comments · Fixed by #38659
Labels
Dependencies Required and optional dependencies Testing pandas testing functions or related to the test suite Visualization plotting
Milestone

Comments

@TomAugspurger
Copy link
Contributor

This is with matplotlib 2.1.0

===================================================================== warnings summary ======================================================================
pandas/tests/plotting/test_frame.py::TestDataFramePlots::()::test_subplots_multiple_axes
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_tools.py:204: UserWarning: When passing multiple axes, layout keyword is ignored
    "ignored", UserWarning)

pandas/tests/plotting/test_frame.py::TestDataFramePlots::()::test_line_colors
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_core.py:188: UserWarning: 'colors' is being deprecated. Please use 'color'instead of 'colors'
    warnings.warn(("'colors' is being deprecated. Please use 'color'"

pandas/tests/plotting/test_frame.py::TestDataFramePlots::()::test_errorbar_plot
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_core.py:1727: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    plot_obj.generate()
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_core.py:1727: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    plot_obj.generate()
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_core.py:1727: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    plot_obj.generate()

pandas/tests/plotting/test_frame.py::TestDataFramePlots::()::test_errorbar_timeseries
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_core.py:1727: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    plot_obj.generate()
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_core.py:1727: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    plot_obj.generate()
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_core.py:1727: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    plot_obj.generate()

pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::()::test_hist_legacy
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)

pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::()::test_tight_layout
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/tests/plotting/test_hist_method.py:248: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    _check_plot_works(df.hist)

pandas/tests/plotting/test_misc.py::TestSeriesPlots::()::test_autocorrelation_plot
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)

pandas/tests/plotting/test_misc.py::TestDataFramePlots::()::test_andrews_curves
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)

pandas/tests/plotting/test_misc.py::TestDataFramePlots::()::test_parallel_coordinates_with_sorted_labels
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/axes/_base.py:2918: UserWarning: Attempting to set identical left==right results
  in singular transformations; automatically expanding.
  left=0, right=0
    'left=%s, right=%s') % (left, right))

pandas/tests/plotting/test_misc.py::TestDataFramePlots::()::test_radviz
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/pyplot.py:959: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    return gcf().gca(**kwargs)

pandas/tests/plotting/test_series.py::TestSeriesPlots::()::test_hist_legacy
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
  /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    warnings.warn(message, mplDeprecation, stacklevel=1)
@TomAugspurger TomAugspurger added Compat pandas objects compatability with Numpy or Python functions Dependencies Required and optional dependencies Difficulty Intermediate Visualization plotting labels Nov 15, 2017
@TomAugspurger TomAugspurger added this to the Next Major Release milestone Nov 15, 2017
@mroeschke mroeschke added Testing pandas testing functions or related to the test suite and removed Compat pandas objects compatability with Numpy or Python functions labels Apr 5, 2020
@jbrockmendel
Copy link
Member

Still relevant?

@jbrockmendel jbrockmendel added the Closing Candidate May be closeable, needs more eyeballs label Sep 23, 2020
@fangchenli
Copy link
Member

Still many warnings. This is with matplotlib 3.3.1.

============================================================================================================================================== warnings summary ===============================================================================================================================================
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_hf
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_hf
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_dtypes
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_dtypes
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_dtypes
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_dtypes
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_dtypes
pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_irreg_dtypes
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/core/frame.py:3204: FutureWarning: Automatically casting object-dtype Index of datetimes to DatetimeIndex is deprecated and will be removed in a future version.  Explicitly cast to DatetimeIndex instead.
    return klass(values, index=self.index, name=name, fastpath=True)

pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_pie_df_nan
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/plotting/_matplotlib/core.py:1547: MatplotlibDeprecationWarning: normalize=None does not normalize if the sum is less than 1 but this behavior is deprecated since 3.3 until two minor releases later. After the deprecation period the default value will be normalize=True. To prevent normalization pass normalize=False 
    results = ax.pie(y, labels=blabels, **kwds)

pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_errorbar_plot
pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_errorbar_plot
pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_errorbar_plot
pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_errorbar_timeseries
pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_errorbar_timeseries
pandas/tests/plotting/test_frame.py::TestDataFramePlots::test_errorbar_timeseries
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/plotting/_matplotlib/__init__.py:61: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    plot_obj.generate()

pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_series.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_series.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_series.py::TestSeriesPlots::test_hist_legacy
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/tests/plotting/common.py:535: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    kwargs.get("ax", fig.add_subplot(211))

pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_series.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_series.py::TestSeriesPlots::test_hist_legacy
pandas/tests/plotting/test_series.py::TestSeriesPlots::test_hist_legacy
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/tests/plotting/common.py:543: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
    kwargs["ax"] = fig.add_subplot(212)

pandas/tests/plotting/test_hist_method.py::TestSeriesPlots::test_hist_with_legend[b-2-expected_layout1]
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/plotting/_matplotlib/hist.py:354: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    axes = _grouped_hist(

pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::test_tight_layout
pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::test_hist_column_order_unchanged[None-expected0]
pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::test_hist_column_order_unchanged[column1-expected1]
pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::test_hist_with_legend[None-None]
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/tests/plotting/common.py:545: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    ret = f(**kwargs)

pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::test_hist_subplot_xrot
pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::test_hist_with_legend[None-c]
pandas/tests/plotting/test_hist_method.py::TestDataFramePlots::test_hist_with_legend[b-c]
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/plotting/_matplotlib/hist.py:396: UserWarning: To output multiple subplots, the figure containing the passed axes is being cleared
    axes = _grouped_hist(

pandas/tests/plotting/test_misc.py::TestSeriesPlots::test_autocorrelation_plot
pandas/tests/plotting/test_misc.py::TestSeriesPlots::test_autocorrelation_plot
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/plotting/_matplotlib/misc.py:443: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    ax = plt.gca(xlim=(1, n), ylim=(-1.0, 1.0))

pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_andrews_curves
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/plotting/_matplotlib/misc.py:263: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    ax = plt.gca(xlim=(-np.pi, np.pi))

pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_radviz
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_radviz
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_radviz
pandas/tests/plotting/test_misc.py::TestDataFramePlots::test_radviz
  /home/fangchenli/Workspace/pandas-fangchenli/pandas/plotting/_matplotlib/misc.py:147: UserWarning: Requested projection is different from current axis projection, creating new axis with requested projection.
    ax = plt.gca(xlim=[-1, 1], ylim=[-1, 1])

@fangchenli fangchenli removed the Closing Candidate May be closeable, needs more eyeballs label Oct 1, 2020
@jreback jreback modified the milestones: Contributions Welcome, 1.3 Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Required and optional dependencies Testing pandas testing functions or related to the test suite Visualization plotting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants