Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a function to make scatterplot matrices in matplotlib?

Example of scatterplot matrix

enter image description here

Is there such a function in matplotlib.pyplot?

like image 569
hatmatrix Avatar asked Oct 29 '11 19:10

hatmatrix


People also ask

What function is required to make a scatterplot matrix?

There are many ways to create a scatterplot in R. The basic function is plot(x, y), where x and y are numeric vectors denoting the (x,y) points to plot.

Which method in pandas tools plotting is used to create scatter plot matrix?

1 Answer. The scatter plot matrix can be created by using DataFrame. plot. scatter() method.


1 Answers

For those who do not want to define their own functions, there is a great data analysis libarary in Python, called Pandas, where one can find the scatter_matrix() method:

from pandas.plotting import scatter_matrix df = pd.DataFrame(np.random.randn(1000, 4), columns = ['a', 'b', 'c', 'd']) scatter_matrix(df, alpha = 0.2, figsize = (6, 6), diagonal = 'kde') 

enter image description here

like image 153
Roman Pekar Avatar answered Oct 13 '22 00:10

Roman Pekar