March 2014
Beginner to intermediate
222 pages
4h 7m
English
As seen in the previous recipe, we can control the style of markers; controlling their size also works along the same lines. In this recipe, we are going to see how to control marker sizes.
A marker's size is controlled in the same way as other marker attributes, with a dedicated optional parameter as shown in the following script:
import numpy as np import matplotlib.pyplot as plt A = np.random.standard_normal((100, 2)) A += np.array((-1, -1)) B = np.random.standard_normal((100, 2)) B += np.array((1, 1)) plt.scatter(B[:,0], B[:,1], c = 'k', s = 100.) plt.scatter(A[:,0], A[:,1], c = 'w', s = 25.) plt.show()
The preceding script produces the following graph:
In this example, we display two sets of points of ...
Read now
Unlock full access