You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often, we find people using the pyplot interface, and expect plt.show to work. Although this uses a global object, and we live in a shared process (virtual kernels), this can be properly scoped.
feat: improve matplotlib support - as Jupyter
Several improvements:
## Default backend
We do this by checking if the env var 'MPLBACKEND' is not set, and if so, we set it to
module://matplotlib_inline.backend_inline
## Support for display(figure)
This makes it behave more like the Jupyter notebook environment.
## Support matplotlib pylab interface in solara server
This makes code that 'just works' in the notebook also work in solara
server. We patch global dicts with scoped dicts.
See #539
cc @koaning
While preparing a demo of https://github.com/koaning/drawdata using the original notebook to run on solara-server, we need to make the following changes.
Assign the widget to display to the page variable
This is mentioned in the tutorial for script: https://solara.dev/docs/tutorial/ipywidgets
And also mentioned here: https://solara.dev/docs/reference/notebook-support
But, in notebook, we often display the last expression. I think we can do that if no
Page
orpage
variable is found.We needed to modify the notebook like this:
Improved matplotlib support
Although we support matplotlib: https://solara.dev/api/matplotlib
Often, we find people using the pyplot interface, and expect plt.show to work. Although this uses a global object, and we live in a shared process (virtual kernels), this can be properly scoped.
We needed the following diff
I think we can fix both issues, and run the notebook unmodified as:
The text was updated successfully, but these errors were encountered: