This code worked for me using Python 3.5.2:
import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from sklearn import datasets iris_dataset = datasets.load_iris() X = iris_dataset.data Y = iris_dataset.target iris_dataframe = pd.DataFrame(X, columns=iris_dataset.feature_names)
For pandas version <v0.20.0.
Thanks to michael-szczepaniak , indicating that this API is deprecated.
grr = pd.scatter_matrix(iris_dataframe, c=Y, figsize=(15, 15), marker='o', hist_kwds={'bins': 20}, s=60, alpha=.8)
I just had to remove the cmap=mglearn.cm3 fragment because I could not get mglearn to work. There is a version mismatch issue with sklearn.
In order not to display the image and save it directly to a file, you can use this method:
plt.savefig('foo.png')
Also remove

source share