Skip to content

pontink

pontink converts Matplotlib figures into pont.ink JSON so users can reopen and edit plots in the web app.

  • Package version: 1.0.0
  • pont.ink document schema version: 1.0

What gets exported

  • Datasets/layers from Line2D (ax.plot) and PathCollection (ax.scatter)
  • Figure suptitle plus subplot title, axis labels, axis limits, grid flag, and legend visibility/position
  • Data-space text annotations (ax.text with data transform)
  • A full pont.ink session envelope (document + UI view metadata)
  • Image exports (png, svg, pdf, eps, ps, ...) with:
  • embedded pont.ink document metadata where supported
  • default footer: Edit this plot on pont.ink! (can be disabled)

What you can do after loading in pont.ink

  • Reassign series to multiple subplots in a shared figure grid
  • Edit subplot titles, figure title, and axis labels visually on the canvas
  • Drag legend and label positions directly
  • Add text, arrow, horizontal-line, and vertical-line annotations
  • Run fits in the web UI and bind hline / vline positions to fit parameters

Important current scope

  • The Python converter still exports only the first visible Matplotlib axes from a figure.
  • Multi-subplot editing is available in the web app, but it is not reconstructed automatically from multi-axes Matplotlib figures yet.
  • Existing Matplotlib axhline / axvline artists are not imported as native pont.ink line annotations yet.

Quick Example

import matplotlib.pyplot as plt
from pontink import figure_to_session_file

fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
ax.plot([0, 1, 2], [0.0, 1.1, 2.1], marker="o", label="Signal")
ax.set_title("Very Nice Data")
ax.set_xlabel("Time")
ax.set_ylabel("Value")
ax.grid(True)
ax.legend()

result = figure_to_session_file(fig, "my-plot.pontink.json")
print(result.warnings)

You can load that JSON in pont.ink with the Load action.