A scatter plot matrix
A scatter plot matrix can be formed for a collection of variables where each of the variables will be plotted against each other. The following code generates a DataFrame
df, which consists of four columns with normally distributed random values and column names named from
>>> df = pd.DataFrame(np.random.randn(1000, 4), columns=['a', 'b', 'c', 'd']) >>> spm = pd.tools.plotting.scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='hist')
After the preceding code is executed we'll get the following output:
scatter_matrix() function helps in plotting the preceding figure. It takes in the data frame object and the ...