Matplotlib - Performance and Large Data
You have a very large dataset with 1 million points. You want to plot it using matplotlib but keep the plot responsive and clear. Which downsampling strategy should you choose and how?
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 100, 1_000_000)
y = np.sin(x) + np.random.normal(0, 0.1, 1_000_000)
fig, ax = plt.subplots()
line, = ax.plot(x, y)
# What next?
