matplotlib-pyodide
matplotlib-pyodide copied to clipboard
Matplotlib does not work
🐛 Bug
Matplotlib does not render plots
To Reproduce
- go to https://pyodide.org/en/latest/console.html
- run the following:
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> plt.plot(np.sin(np.linspace(0, 0.05, 200) * np.pi * 2 * 100))
[<matplotlib.lines.Line2D object at 0x1fc7878>]
>>> plt.show()
>>>
Expected behavior
The plot shows up, either inline or as popup
Environment
- Pyodide Version: latest
- Browser version: Google Chrome, 96.0.4664.93 (Official Build) (64-bit)
The console does not support that, you should use for example: JupyterLite.
I'd prefer not to use jupyter for embedding though
I agree we should add an example with matplotlib (related pyodide/pyodide#1498 ).
Adding support for matplotlib to the REPL is another matter, personally, I don't think it would be in the scope of Pyodide (unless someone can demonstrate that it would be very easy to do). We would rather keep the REPL simple, and leave this work to other projects.
I think it could be fun to have a more fully featured repl at some point, maybe in a separate repo inside of the pyodide org. But yeah, console.html shouldn't get very complicated. I think that jqueryterminal does have support for echoing html and will render it in a reasonable way, so it is possible that this could be done without too much extra complexity.