It's quite easy to generate generate the graph of a function that depends 
upon a parameter and illustrate how that graph changes when we change the 
parameter using interact. A simple example to interact with the frequency 
of a sine function might be written as follows:

%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from ipywidgets import interact, FloatSlider

def myplot(a):
    xs = np.linspace(-3,3,100)
    ys = np.sin(a*xs)
    plt.plot(xs,ys)
demo = interact(myplot, a=FloatSlider(value=1, min=-3, max=3, step=0.01))

When I do so, though, the axes flicker as I move the slider. I can improve 
the situation a bit by setting the axes ticks and limits but I can't seem 
to get it to go away entirely. I would guess that a better solution would 
be to create one axes instance and fiddle with the lines directly, but I 
haven't got that to work either.

What is the best practice for interacting with these types of graphics 
smoothly?

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/c512ae9a-e66a-4f81-b6ef-f79fd6bf5d6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to