On Saturday, January 14, 2017 at 9:55:31 AM UTC-5, Sylvain Corlay wrote:

The problem is that the rendering logic for matplotlib resides in the 
> backend. I would recommand using the "notebook" backend for matplotlib 
> which should improve the situation.
>
> Or you can use a plotting library for the notebook such as bqplot.
>

Thanks! the notebook backend seemed much worse. bqplot seems very new and, 
I'm guessing that it will be the way to work with 2D graphics in the 
notebook. For the record, I was able to piece together the following after 
a little fiddling:

import numpy as np
from bqplot import pyplot as plt
from ipywidgets import interact, FloatSlider

fig = plt.figure(1)
def myplot(a):
    xs = np.linspace(-3,3,100)
    ys = np.sin(a*xs)
    if fig.marks == []:
        plt.plot(xs,ys)
    else:
        fig.marks[0].y = ys
demo = interact(myplot, a=FloatSlider(value=1, min=-3, max=3, step=0.01))
plt.ylim(-1.1,1.1)
plt.show()

This seems to work quite well.

Thanks again!


-- 
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/1d4935fd-b035-4c7f-bbf7-8aa04ed20d4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to