July 2017
Beginner to intermediate
420 pages
10h 56m
English
A scatter plot is something we'll see pretty often in this book. So, say you have a couple of different attributes you want to plot for the same set of people or things. For example, maybe we're plotting ages against incomes for each person, where each dot represents a person and the axes represent different attributes of those people.
The way you do that with a scatter plot is you call plt.scatter() using the two axes that you want to define, that is, the two attributes that contain data that you want to plot against each other.
Let's say I have a random distribution in X and Y and I scatter those on the scatter plot, and I show it:
from pylab import randn X = randn(500) Y = randn(500) plt.scatter(X,Y) plt.show() ...
Read now
Unlock full access