Skip to content
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

_AxesBase.axis() is called with incorrect arguments in plot_decision_regions() #673

Open
albertjin opened this issue Mar 23, 2020 · 1 comment

Comments

@albertjin
Copy link

I am referring to the function plot_decision_regions() in file mlxtend/plotting/decision_regions.py, at line 249,

ax.axis(xmin=xx.min(), xmax=xx.max(), y_min=yy.min(), y_max=yy.max())

This line causes a warning message :

.../site-packages/mlxtend/plotting/decision_regions.py:249: MatplotlibDeprecationWarning: Passing unsupported keyword arguments to axis() will raise a TypeError in 3.3.
  ax.axis(xmin=xx.min(), xmax=xx.max(), y_min=yy.min(), y_max=yy.max())

Here is the document of axis(),

def axis(self, *args, emit=True, **kwargs):
        """
        Convenience method to get or set some axis properties.

        Call signatures::

          xmin, xmax, ymin, ymax = axis()
          xmin, xmax, ymin, ymax = axis([xmin, xmax, ymin, ymax])
          xmin, xmax, ymin, ymax = axis(option)
          xmin, xmax, ymin, ymax = axis(**kwargs)
...

It indeed does not call the method with expected arguments and should simply changed as follows,

ax.axis([xx.min(), xx.max(), yy.min(), yy.max()])
@rasbt
Copy link
Owner

rasbt commented Mar 23, 2020

Thanks for the note, it looks like there's been some change in matplotlib recently (didn't get the warning in previous version). I can patch that via a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants