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)
  • Axes labels/title, 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)

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.