-
Notifications
You must be signed in to change notification settings - Fork 231
Description
Dear ipympl community,
I don't know if this is the right place to post, but I couldn't find a discussions tab on this repo.
I have been using Matplotlib and ipympl for many years now.
I recently started a new project which aims to address some of the issues of ipympl, mainly to do with performance of user interactivity.
The project is called Matplotgl (repo: https://github.com/scipp/matplotgl/, docs: https://scipp.github.io/matplotgl/). It tries to be a (almost) drop-in replacement for Matplotlib, but uses Pythreejs for rendering the graphics (note that currently it is only available on pip).
Because of the webgl enabled by Pythreejs, it will easily handle 500,000 scatter points, or large (4096x4096) images, with smooth panning and zooming.
I have to underline that at this point, it is still extremely early days, and not much of the Matplotib API works. But we do support some basic examples, such as:
import matplotgl.pyplot as plt # Note 'matplotgl' instead of 'matplotlib'
import numpy as np
fig, ax = plt.subplots()
xx, yy = np.random.normal(size=(2, 300_000))
scat = ax.scatter(xx, yy)
ax.set_xlabel('X position [m]')
ax.set_ylabel('Y position [m]')
ax.set_title("A large scatter plot")
fig
A figure in matplotgl is constructed using the following elements:
I would like to know if there is any interest in the community for such a project, if you think the approach is viable, and if there are any good ideas as to how we could support a large part of the matplotlib API without having to duplicate it all.
If you are interested, please play with it, report bugs, and you may even want to contribute? There are many things that still need to be implemented ;-)
Many thanks!
(and apologies again for spamming the issue list, I wasn't sure how else to reach out; feel free to close the issue if you think this should be posted somewhere else)