April 2018
Beginner to intermediate
300 pages
7h 34m
English
While we have seen a scatter plot of random dots before, scatter plots are most useful with representing discrete data points that show a trend or clusters. Each data series will be plotted in different color per plotting command by default, which helps us distinguish the distinct dots from each series. To demonstrate the idea, we will generate two artificial clusters of data points using a simple random number generator function in NumPy, shown as follows:
import matplotlib.pyplot as plt# seed the random number generator to keep results reproduciblenp.random.seed(123) # Generate 10 random numbers around 2 as x-coordinates of the first data seriesx0 = np.random.rand(10)+1.5# Generate the y-coordinates another ...
Read now
Unlock full access