Davide-sd / sympy-plot-backends

An improved plotting module for SymPy
BSD 3-Clause "New" or "Revised" License
44 stars 10 forks source link

matplotlib widget plot displays twice #3

Closed sadguitarius closed 2 years ago

sadguitarius commented 2 years ago

Hi, after a recent conda update, I'm seeing all plots using the Matplotlib widget displaying twice in Jupyterlab. This doesn't happen with inline non-interactive plots, and it also doesn't happen with other Matplotlib plots outside of spb. The behavior is also not affected by adding a semicolon to the end of the plot command. I'm not sure exactly which update caused this to happen. For what it's worth, I'm running Jupyterlab inside of WSL on Windows 10. Other than that, thank you for this great package and let me know if you need any other info about my setup that might help you to figure out what's going on.

Davide-sd commented 2 years ago

Hello @sadguitarius , thanks for letting me know.

I will start to debug this issue next week! Would you please share which version of Jupyterlab you are using?

sadguitarius commented 2 years ago

Sounds good! I'm using Jupyterlab 3.1.11

sadguitarius commented 2 years ago

Following up on this, I tried again in a clean conda environment and was able to suppress the second output by adding

import matplotlib.pyplot as plt
plt.ioff()

along with the usual spb and sympy imports. Seems like there is some default setting for matplotlib interactive mode that is messing things up somewhere. Hope this helps!

Davide-sd commented 2 years ago

@sadguitarius Sorry for the late reply.

I believe there is some bug with the latest version of ipympl. An older version, v0.7.0, do not manifest that problem.

In the meantime, I've opened a bug upstream.

Davide-sd commented 2 years ago

Closing this issue. There was a bug in my code which has been fixed in v1.0.0. Thanks for letting me know!