I made an online editor that runs matplotlib in your browser
Are there any free websites that let you run Python without installing actual Python?
Checkout Google colab
More on reddit.comVideos
I work in academia, and plotting is one of the most painful things. Most of the time I end up with multiple virtual environments and files spread across my file system with plots for experiments, presentations, or papers. It is especially inconvenient when I want to reuse some old designs.
A couple of weeks ago I found out about Pyodide, which is a Python interpreter compiled to Webassembly that allows to run Python code in the browser, and it supports matplotlib! So I had the idea to create a website similar to Overleaf but for plotting with matplotlib.
The website is just a quick prototype, but it works. You can create multiple projects (which are stored in localStorage). When you select a project, there is a code editor and the plot output. The first time you open a project it takes some time to download Python, but the next executions are really fast IMO (just press "Ctrl/Cmd + S" inside the editor to execute the code). The cool thing is that with Pyodide everything happens in your browser! No servers are involved in executing your code.
You can check it out here: https://matplotlib.online
Features already present:
-
Two columns, one for the code, and one for the plot. Much better than google collab (when the code starts to grow)
-
Import 1-dimensional variables from spreadsheets: We have all the experimental data in spreadsheets, and it's a pain to convert it to Python for plotting. So I implemented a feature where you directly paste one spreadsheet row/column and it converts the data into a Python list.
-
Vim/emacs/sublime text mode
Things I'm planning to add in the future:
-
Render the figure in a different window, to allow an efficient use of dual-screen setups.
-
Allow to optionally create an account to store the scripts in a server (now they reside in the browser storage).
-
I would love to have a feature where I could paste 2-dimensional data from a spreadsheet and get a matplotlib code/plot, just like you do in Google Docs or Excel.
-
Collaborative editing would be awesome but I don't think I will be able to implement it soon.
-
Better design/UX. I'm not a web developer so this is not my strongest skill.
Let me know what do you think about it :)