matplotlib scatter plot python

Solutions on MaxInterview for matplotlib scatter plot python by the best coders in the world

showing results for - "matplotlib scatter plot python"
Emanuele
07 Oct 2017
1import numpy as np
2np.random.seed(19680801)
3import matplotlib.pyplot as plt
4
5
6fig, ax = plt.subplots()
7for color in ['tab:blue', 'tab:orange', 'tab:green']:
8    n = 750
9    x, y = np.random.rand(2, n)
10    scale = 200.0 * np.random.rand(n)
11    ax.scatter(x, y, c=color, s=scale, label=color,
12               alpha=0.3, edgecolors='none')
13
14ax.legend()
15ax.grid(True)
16
17plt.show()