Skip to main content

adopt-plot

Or AdoptPlot

A library for plotting implicit functions using two rendering engines:

  • contour from matplotlib.
  • plot_implicit from sympy which internally uses Adaptive Marching Squares (AMR) — an adaptive algorithm that correctly handles the domain of definition and discontinuities.

Automatic selection: If the equation has domain restrictions (e.g., logarithm or square root), plot_implicit is used. If the function is smooth, the fast contour engine is chosen. Visually, they are indistinguishable, but the best algorithm is selected automatically.


Installation

pip install adopt-plot

Quick Start

Plot a graph in one line:

from adopt_plot import AdoptPlot

# The plot will open immediately
plot = AdoptPlot("y = 2*x + 2")

Or with deferred display (to add custom elements first):

from adopt_plot import AdoptPlot

plot = AdoptPlot("y = sqrt(x)", show=False)
# Add custom elements here:
plot.ax.scatter(2, 2, color='red')
plot.show()
# Show the plot after modifications

All plot elements (axes, fig, plt) are accessible via the plot object and its attributes:

from adopt_plot import AdoptPlot
plot = AdoptPlot("y = 1/x", show=False)
plot.ax.set_xlim(-10, 10)  # Change X-axis limits
plot.save("my_plot.png", dpi=300)# Save to file

my_plot.png

from adopt_plot import AdoptPlot

plot = AdoptPlot("sin(sqrt(x**2 + y**2)) / log(x**2 + y**2 + 1) = 0", show=False)

# Подкручиваем стиль под публикацию
plot.ax.set_title("Implicit function with radial oscillations")
plot.ax.grid(True, linestyle=':', alpha=0.5)

# Сохраняем с высоким DPI
plot.save("publication_ready.png", dpi=300, bbox_inches='tight')
plot.show()

publication_ready.png

Methods

  • show: Show the figure
  • save: Save the figure

Parameters

When creating an AdoptPlot object, the following parameters are available:

  • expr (str): The equation string (e.g., "y = 1/x").
  • lib (Literal['contour', 'implicit', None]): Forced rendering engine. Default is None (automatic selection).
  • xlims, ylims (Tuple[float, float]): Initial visible range for the plot. Default (-20, 20).
  • n (int): Grid density for the contour engine. Default 1300.
  • depth (int): Adaptive refinement depth for plot_implicit. Default 9.
  • linewidth (float): Thickness of the plot line. Default 2.0.
  • limit (float | Tuple[float, float, float, float]): Computational domain. Pass a single number (square) or a tuple of 4 numbers (x_min, x_max, y_min, y_max). Default 100.
  • color (str): Line color. Default 'blue'.
  • legend (bool): Whether to display the legend. Default True.
  • points (bool): Whether to display axis intersection points. Default True.
  • grid (bool): Whether to display the grid. Default True.
  • interact (bool): Allow zooming and panning via keyboard (Ctrl + and Ctrl -). Default True.
  • show (bool): If False, the plot does not open immediately, allowing you to add elements. Default True.
  • text_legend (str): Additional text for the legend. Default None.

License

Distributed under the BSD 3-Clause license.

Metadata

Release files for adopt-plot 0.2.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adopt-plot 0.2.13
File Size Uploaded Provenance Actions
adopt_plot-0.2.13.tar.gz 11.6 kB With provenance Details for adopt_plot-0.2.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adopt-plot 0.2.13
File Interpreter ABI Platform Actions
adopt_plot-0.2.13-py3-none-any.whl Python 3 none any Details for adopt_plot-0.2.13-py3-none-any.whl

Total release size: 22.2 kB

Release files / adopt_plot-0.2.13.tar.gz

Download URL adopt_plot-0.2.13.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
60f6cf1a423c00eca2d9726831f9d21cf94ee2a62c4b5be57dace20ce32954a7
BLAKE2b-256 checksum
How to use checksums
86cc6dbf98600896c68ec82c364411ed6c36fe7a76f30e87892cc5ceed871f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / adopt_plot-0.2.13-py3-none-any.whl

Download URL adopt_plot-0.2.13-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0efc30012577ee79c1daa66fa2da54ae3fc21e81227e0004b825e099fdee6b16
BLAKE2b-256 checksum
How to use checksums
acd21d987389c8ca8fa00ea5d658ff5f3ca25532f4d174cb53414d4461be789e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Security for adopt-plot 0.2.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for adopt_plot-0.2.13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page