improvement: fallback to png for matplotlib when in a non-interactive environment#7924
Merged
improvement: fallback to png for matplotlib when in a non-interactive environment#7924
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
AnirudhDagar
approved these changes
Jan 21, 2026
Contributor
AnirudhDagar
left a comment
There was a problem hiding this comment.
Thanks @mscolnick for the fix. Looks good to me, left a very minor comment. Can also be safely ignored :p
| return manager | ||
|
|
||
|
|
||
| def png_bytes(figure: Union[Figure, SubFigure, Axes]) -> bytes: |
Contributor
There was a problem hiding this comment.
nit: typing includes Axes in the definition, but by the time these are called, Axes will always be converted to Figure here?
if isinstance(figure, Axes):
maybe_figure = figure.get_figure()
assert maybe_figure is not None, "Axes object does not have a Figure"
figure = maybe_figure
Contributor
Author
There was a problem hiding this comment.
yea it should only be Figure, SubFigure
|
|
||
|
|
||
| class NonInteractiveMplHtml(Html): | ||
| def __init__(self, figure: Union[Figure, SubFigure, Axes]) -> None: |
akshayka
approved these changes
Jan 21, 2026
|
Thanks! |
botterYosuke
pushed a commit
to botterYosuke/marimo
that referenced
this pull request
Jan 22, 2026
botterYosuke
pushed a commit
to botterYosuke/marimo
that referenced
this pull request
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we are in a non-interactive environment (e.g.
marimo export html), we fallback to a mime-renderer of pngFixes #7816 (cc @AnirudhDagar)