Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matplotlib does not work #7

Open
Martmists-GH opened this issue Dec 13, 2021 · 4 comments
Open

Matplotlib does not work #7

Martmists-GH opened this issue Dec 13, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@Martmists-GH
Copy link

🐛 Bug

Matplotlib does not render plots

To Reproduce

  1. go to https://pyodide.org/en/latest/console.html
  2. 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)
@Martmists-GH Martmists-GH added the bug Something isn't working label Dec 13, 2021
@oeway
Copy link

oeway commented Dec 13, 2021

The console does not support that, you should use for example: JupyterLite.

@Martmists-GH
Copy link
Author

I'd prefer not to use jupyter for embedding though

@rth
Copy link
Member

rth commented Dec 14, 2021

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.

@hoodmane
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants