The inline matplotlib plots are shown as
png
and look blurry on my 4k monitor. Increasing the plots dpi only scales it up. Is it possible to display them as a
svg
instead?
I already tried locally changing:
marimo/_output/mpl.pydef _internal_show(canvas: FigureCanvasBase) -> None:
buf = io.BytesIO()
buf.seek(0)
canvas.figure.savefig(buf, format="png", bbox_inches="tight")
plt.close(canvas.figure)
mimetype: KnownMimeType = "image/png"
plot_bytes = base64.b64encode(buf.getvalue())
CellOp.broadcast_console_output(
channel=CellChannel.MEDIA,
mimetype=mimetype,
data=build_data_url(mimetype=mimetype, data=plot_bytes),
cell_id=None,
status=None,
)
to
def _internal_show(canvas: FigureCanvasBase) -> None:
buf = io.BytesIO()
buf.seek(0)
canvas.figure.savefig(buf, format="svg", bbox_inches="tight")
plt.close(canvas.figure)
mimetype: KnownMimeType = "image/svg+xml"
plot_bytes = base64.b64encode(buf.getvalue())
CellOp.broadcast_console_output(
channel=CellChannel.MEDIA,
mimetype=mimetype,
data=build_data_url(mimetype=mimetype, data=plot_bytes),
cell_id=None,
status=None,
)
but it still shows up as a png.