API¶
Python API¶
convert_figure(fig) -> ConversionResult¶
Converts a Matplotlib Figure and returns:
document: pont.ink document objectsession: pont.ink session objectwarnings: list of conversion warnings
figure_to_document(fig) -> dict¶
Returns only the pont.ink document.
figure_to_session(fig) -> dict¶
Returns only the pont.ink session envelope.
figure_to_document_file(fig, output_path, indent=2) -> ConversionResult¶
Writes a document JSON file.
figure_to_session_file(fig, output_path, indent=2) -> ConversionResult¶
Writes a session JSON file.
export_figure_file(fig, output_path, ...) -> ConversionResult¶
Exports an image file from Matplotlib and optionally embeds pont.ink document metadata.
Key options:
export_format: explicit format override (otherwise inferred from file extension)dpi: output DPI overrideinclude_edit_remark: defaults toTrueedit_remark_text: defaults toEdit this plot on pont.ink!embed_document: defaults toTrue
CLI¶
Convert pickled Figure to session JSON¶
pontink-export figure.pkl out.pontink.json
Convert pickled Figure to document JSON¶
pontink-export figure.pkl out.document.json --document
Export image with embedded document metadata¶
pontink-export figure.pkl out.svg
pontink-export figure.pkl out.png --no-edit-remark
pontink-export figure.pkl out.pdf --dpi 300
pontink-export figure.pkl out.eps
CLI flags¶
--document: write document-only JSON--indent N: JSON indentation (default2)--format: force image format--dpi: set image DPI--no-embed-document: skip embedding pont.ink document metadata--no-edit-remark: disable default footer remark--edit-remark-text: custom footer text