xeus-python: Matplotlib does not work with xeus-python

On XEUS 0.23.9 I find that using the @interact decorator and sliders that they will appear fine and as expected, however when they are attached to figures they don’t display properly.

Here is a minimal example that doesn’t work on my system:

from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
import matplotlib.pyplot as plt
@interact(n=(1,7))
def plotN(n):
    vals = [i for i in range(n)]
    plt.plot(vals)

expected behaviour: img

actual behaviour: img

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

It’s just that Matplotllib does not work by default. We’ll find a way to make it work soon.

I do have the front-end installed, but I still only get the object location with no plot.

@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK

Is there anything else I can provide to help diagnose the issue?

Would be interesting to know once this is resolved. I need matplotlib for my research, but would love to have the debugging tool available.

Thanks for creating xeus-python. Amazing tool 😃

Yes, from our earlier in-person, that seems like a sensible approach.

One idea might be to export the https://github.com/ipython/ipykernel/blob/master/ipykernel/pylab module outside of ipykernel, make it a separate package. Then we’ll reuse it in ipykernel and xeus-python. That’s the cleanest solution IMO.