adopt-plot
Or AdoptPlot
A library for plotting implicit functions using two rendering engines:
contourfrommatplotlib.plot_implicitfromsympywhich 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
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()
[]("sin(sqrt(x2 + y2)) / log(x2 + y2 + 1) = 0)
Methods
show: Show the figuresave: 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 isNone(automatic selection).xlims,ylims(Tuple[float, float]): Initial visible range for the plot. Default(-20, 20).n(int): Grid density for thecontourengine. Default10000.depth(int): Adaptive refinement depth forplot_implicit. Default9.linewidth(float): Thickness of the plot line. Default2.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). Default100.color(str): Line color. Default'blue'.legend(bool): Whether to display the legend. DefaultTrue.points(bool): Whether to display axis intersection points. DefaultTrue.grid(bool): Whether to display the grid. DefaultTrue.interact(bool): Allow zooming and panning via keyboard (Ctrl +andCtrl -). DefaultTrue.show(bool): IfFalse, the plot does not open immediately, allowing you to add elements. DefaultTrue.text_legend(str): Additional text for the legend. DefaultNone.
License
Distributed under the BSD 3-Clause license.
Metadata
Release files for adopt-plot 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| adopt_plot-0.1.8.tar.gz | 11.5 kB | Without provenance | Details for adopt_plot-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| adopt_plot-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for adopt_plot-0.1.8-py3-none-any.whl |
Total release size: 22.0 kB
Release files / adopt_plot-0.1.8.tar.gz
| Download URL | adopt_plot-0.1.8.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f23baa1c269fc55583eef9227f1b3006d26fe947bfeb1684c8e08831f600aa47
|
|
BLAKE2b-256 checksum How to use checksums |
b44c99719450117deb9ed9c497d34a31f25eb54a89dcc3bce2e192675188f806
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / adopt_plot-0.1.8-py3-none-any.whl
| Download URL | adopt_plot-0.1.8-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07d3cfe1ea54385e4b1226eed9eecc87f460c46872dffad9dd7691565d0ebffc
|
|
BLAKE2b-256 checksum How to use checksums |
c274018dcf2c6c6dbb2960399989f012d1bce0036f98380c85f581d5217647dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for adopt-plot 0.1.8
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.