marimo_utils

Utilities for working with marimo notebooks.

neutcurve.marimo_utils.display_fig_marimo(fig, display_method)[source]

Display large matplotlib figure via marimo.

This function is designed when you have a very large matplotlib figure (eg, as produced by the plotting functions of neutcurve.curvefits.CurveFits) and you want to display it in marimo notebook.

Running this function requires you to have separately installed marimo and (if you are using display_method=”png8”) `pillow

Args:
fig (matplotlib..figure.Figure)

The figure we want to display.

display_method {“inline”, “svg”, “pdf”, “png8”}

Display the figure just inline, as a SVG, as a PDF, or as a PNG8. In general, displaying as a PNG8 will be the smallest size although also the lowest resolution.

Returns:
output_obj

The returned object can be display in marimo, via marimo.output.append(output_obj)