.. _pylab_examples-interp_demo:

pylab_examples example code: interp_demo.py
===========================================



.. plot:: /builddir/build/BUILD/matplotlib-1.3.1/doc/mpl_examples/pylab_examples/interp_demo.py

::

    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 :ref:`how-to-search-examples`)