RaduW
RaduW
Mmarimo
Created by RaduW on 1/4/2025 in #help-support
matplotlib plot only shown in edit mode
Hello, I have been trying Marimo over the weekend and I find it great. All the problems bothering me in Jupyter Notes and some I didn't even realize I had seem to be addressed in Marimo. There is one thing I cannot seem to figure out: If I create a plot (the most basic plot) using matplotlib it shows correctly as long as I'm in edit mode but as soon as I switch to View mode, or slide mode, or I run marimo run my_notebook.py the matlib plots are not shown anymore. I have also tried with plotly and I get the same problem, the plots are only visible when the notebook is in edit mode. altair plots seem to be fine though ( they are also visible when I switch to view mode). I thought this might be a limitation but then I saw examples where matplotlib is being used and the plots are successfully displayed, like the example: Neural Networks with Micrograd https://marimo.io/p/@marimo/micrograd I've seen that the exmaple uses WASM and tried to generate a WASM application from my notebook using:
marimo export html-wasm notebook.py -o notebook.wasm.html
marimo export html-wasm notebook.py -o notebook.wasm.html
and then serving the generated html. This did not seem to make any difference, the matplotlib plots still do not show. Am I missing something ? Thank you in advance for any answers or suggestions.
9 replies