You are reading an old version of the documentation (v1.4.3). For the latest version see https://matplotlib.org/stable/

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

pylab_examples example code: image_slices_viewer.py

Next topic

pylab_examples example code: invert_axes.py

This Page

pylab_examples example code: interp_demo.pyΒΆ

(Source code, png, hires.png, pdf)

../../_images/interp_demo.png
import matplotlib.pyplot as plt
from numpy import pi, sin, linspace
from matplotlib.mlab import stineman_interp

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

fig, ax = plt.subplots()
ax.plot(x,y,'ro',xi,yi,'-b.')
plt.show()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)