Closed sabarezaeii closed 1 year ago
I also have tried this below code which I found in in your github http://rasbt.github.io/mlxtend/user_guide/plotting/plot_decision_regions/ and ran that both on a jupyter notebook on my computer and google Collab, and I gat the same error: axis() got an unexpected keyword argument 'y_min' !!
from mlxtend.plotting import plot_decision_regions import matplotlib.pyplot as plt from sklearn import datasets from sklearn.svm import SVC
iris = datasets.load_iris() X = iris.data[:, [0, 2]] y = iris.target
svm = SVC(C=0.5, kernel='linear') svm.fit(X, y)
plot_decision_regions(X, y, clf=svm, legend=2)
plt.xlabel('sepal length [cm]') plt.ylabel('petal length [cm]') plt.title('SVM on Iris') plt.show()
Hm , that's weird. Haven't seen that before. What version of mlxtend are you using? Can you do an
import mlxtend
print(mlxtend.__version__)
Thanks for responding.
I have tried two different versions of mlxtend: 0.13.0 and 0.21.0
is that possible that matplotlib has updated something that caused this issue?
Good point. Haven't updated my matplotlib in a while. What version are you using? I am currently on '3.5.1' where it works ok.
yesss, That was a matplotlib version problem. now I have matplotlib 3.5.3 and mlxtend 0.21.0, and everything is working.
thank you for your help.
glad to hear that it could be (relatively) easily resolved!
Ah sorry, forgot to ask: did you have an older or newer matplotlib version?
I had matplotlib 3.5.2.
oh maybe an intermediate issue between 3.5.1 and 3.5.3 then hmmm
Hello, I am having the same issue. I am trying to run a very simple example to check plot_decision_regions and I get the following error:
axis() got an unexpected keyword argument 'y_min'
my code:
X = np.array([[0.3,1],[0.5,4.5],[1,2.3],[1.4,1.9],[1.7,8.9],[2,4.1],[3.3,7],[3.5,1.5],[4,6.3],[4.4,1.9],[5.7,2.9],[6,7.1]]) y = np.array([0,0,0,0,0,0,1,1,1,1,1,1]) plot_decision_regions( X, y, clf=classifier, legend=2)
plt.show()