Jupyter Notebook: interactive plot with widgets : <p>I am trying to generate an interactive plot that depends on widgets.
The problem I have is that when I change parameters using the slider, a new plot is done after the previous one, instead I would expect only one plot changing according to the parameters.</p>

<p><strong>Example:</strong></p>

<pre><code>from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets

import matplotlib.pyplot as plt
%matplotlib inline

import numpy as np

def plot_func(freq):
    x = np.linspace(0, 2*np.pi)
    y = np.sin(x * freq)
    plt.plot(x, y)

interact(plot_func, freq = widgets.FloatSlider(value=7.5,
                                               min=1,
                                               max=5.0,
                                               step=0.5))
</code></pre>

<p>After moving the slider to 4.0, I have:</p>

<p><a href="https://i.stack.imgur.com/7zhnE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7zhnE.png" alt="enter image description here"></a></p>

<p>while I just want one figure to change as I move the slider.
How can I achieve this?</p>

<p>(I am using Python 2.7, matplotlib 2.0 and I have just updated notebook and jupyter to the latest version. let me know if further info is needed.)</p>
