April 2018
Beginner to intermediate
300 pages
7h 34m
English
In a scatter plot, we can specify the marker size with the parameter s and the marker color with c in the plt.scatter() function.
To draw markers on line plots, we first specify the shape of the markers in the plt.plot() function, such as marker='x'. Marker colors follow the line color.
Please note that scatter plots accept list types as size and color values, convenient in visualizing clusters, while line plots only accept a single value per data series.
Let's look at the following example:
import numpy as npimport matplotlib.pyplot as pltimport matplotlib.colors# Prepare a list of integersn = list(range(5))# Prepare a list of sizes that increases with values in ns = [i**2*100+100 for i in n]# Prepare a ...
Read now
Unlock full access