RaduW
RaduW
Mmarimo
Created by RaduW on 1/4/2025 in #help-support
matplotlib plot only shown in edit mode
@Haleshot the docs do reflect the proper way to use matplotlib https://docs.marimo.io/guides/working_with_data/plotting/#matplotlib , somehow I totally missed it. I am used to using plt.show() and seeing it working in edit mode made me think that the problem might be related to properly configuring the drawing backend, or compiling the notebook in WASM ... anything but returning the axes from the cell (which I still find strange, but that's irrelevant). Perhaps putting the information in a shoutout would help stand out.
![Note] To output a matplotlib plot in a cell's output area, include its Axes or Figure object as the last expression in your notebook.
9 replies
Mmarimo
Created by RaduW on 1/4/2025 in #help-support
matplotlib plot only shown in edit mode
@Haleshot thank you very much, your suggestion fixed it! I was indeed using plt.show().
After changing to plt.gca() it started to display the plot also in view mode ( now it displays the plot above the cell and it used to display below ).
9 replies