marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Sage plots support

Open Eloitor opened this issue 1 year ago • 2 comments

Description

I want to use marimo with sagemath. For example this code works, but the plot is not displayed.

from sage.all import plot, sin
P = plot(sin, (0,10))
P

Suggested solution

Show the plot

Alternative

No response

Additional context

No response

Eloitor avatar Feb 22 '24 08:02 Eloitor

I am not super familiar with the library, but if the plots are serializable to html, it should not be difficult to add.

We would need to add a custom SageFormatter - similar to this PR: https://github.com/marimo-team/marimo/pull/752

mscolnick avatar Feb 22 '24 14:02 mscolnick

I figured out that this works.

from sage.all import plot, sin
P = plot(sin, (0, 10))
P.matplotlib()

However this is not needed in jupyter notebooks.

Eloitor avatar Feb 22 '24 15:02 Eloitor