pandas.plotting.scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False, diagonal='hist', marker='.', density_kwds=None, hist_kwds=None, range_padding=0.05, **kwds)[source]

Draw a matrix of scatter plots.

alphafloat, optional

amount of transparency applied

figsize(float,float), optional

a tuple (width, height) in inches

axMatplotlib axis object, optional
gridbool, optional

setting this to True will show the grid

diagonal{‘hist’, ‘kde’}

pick between ‘kde’ and ‘hist’ for either Kernel Density Estimation or Histogram plot in the diagonal

markerstr, optional

Matplotlib marker type, default ‘.’

hist_kwdsother plotting keyword arguments

To be passed to hist function

density_kwdsother plotting keyword arguments

To be passed to kernel density estimate plot

range_paddingfloat, optional

relative extension of axis range in x and y with respect to (x_max - x_min) or (y_max - y_min), default 0.05

kwdsother plotting keyword arguments

To be passed to scatter function


A matrix of scatter plots.


>>> df = pd.DataFrame(np.random.randn(1000, 4), columns=['A','B','C','D'])
>>> scatter_matrix(df, alpha=0.2)
Scroll To Top