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)

Total running time of the script: ( 0 minutes 0.089 seconds)

Gallery generated by Sphinx-Gallery