You are reading an old version of the documentation (v2.2.0). For the latest version see
Version 2.2.0
Fork me on GitHub

Related Topics

This Page

Interp DemoΒΆ

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 2 * np.pi, 20)
y = np.sin(x)
yp = None
xi = np.linspace(x[0], x[-1], 100)
yi = np.interp(xi, x, y, yp)

fig, ax = plt.subplots()
ax.plot(x, y, 'o', xi, yi, '.')

Gallery generated by Sphinx-Gallery