You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.1.1.post1074+gb67098b
Fork me on GitHub

Related Topics

This Page

Scatter plotΒΆ

This example showcases a simple scatter plot.

import numpy as np
import matplotlib.pyplot as plt

# Fixing random state for reproducibility

N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2  # 0 to 15 point radii

plt.scatter(x, y, s=area, c=colors, alpha=0.5)

Gallery generated by Sphinx-Gallery