Purpose of s and cmap argument in scatter_matrix in python

830 views Asked by At

Exploratory Data Analysis

#create df from data in X_train

#label columns using str in iris_dataset.feature_names

    iris_dataframe = pd.DataFrame(X_train, columns=iris_dataset.feature_names)

#create scatter matrix from df, color by y_train

    grr = pd.plotting.scatter_matrix(iris_dataframe, c=y_train, figsize = (15,15),
                       marker = 'o', hist_kwds={'bins':20}, s=60,
                       alpha=0.8, cmap=mglearn.cm3)

In the above code, I can't understand 's' and 'cmap' use. I know this API has been updated, but I want to learn about the use of 's' and 'cmap=mglearn.cm3' in general use.

1

There are 1 answers

0
R.A On

In plotting.scatter_matrix, 's' and 'cmap' are keyword arguments for matplotlib.pyplot.scatter.

They are optional parameters which can be used with pandas.plotting.scatter_matrix.

's' is used to specify the marker size.

'cmap' defines the colormap.

Here's a link.