Skip to main content

molcrafts-molplot

Unified scientific charting for the MolCrafts stack — the Python / matplotlib half of MolPlot.

It wraps scienceplots and injects MolPlot's unified preset (palette, type scale, grid, light/dark) so a figure made here matches the same preset rendered in the browser by the TypeScript package @molcrafts/molplot.

The bridge between the two renderers is the Vega-Lite spec — a portable JSON intermediate language. Build a spec in Python and either ship it to the web or render it to matplotlib for a publication figure.

Install

pip install molcrafts-molplot
# optional exact web-parity export (real Vega engine → PNG/SVG):
pip install "molcrafts-molplot[convert]"

Style — scienceplots + unified preset

import matplotlib.pyplot as plt
import molplot

molplot.use("molplot")            # scienceplots base + MolPlot overlay
# or a publication variant (serif, high-DPI, scienceplots 'nature' base):
molplot.use("molplot-paper")

with molplot.style("molplot", mode="dark"):
    plt.plot(x, y)                # scoped; restores rcParams on exit

molplot.palette()[0]              # '#0c5da5' — same categorical colours as the web

plt.style.use("molplot") also works directly (the .mplstyle files are registered on import) — but molplot.use() additionally layers the scienceplots base styles named by the preset.

Charts — one call, or via the portable spec

# one call → (fig, ax)
fig, ax = molplot.line(
    [{"id": "E_total", "x": steps, "y": e_total},
     {"id": "E_kin",   "x": steps, "y": e_kin}],
    x_label="step", y_label="energy (kcal/mol)", show_legend=True,
)

# or build the Vega-Lite spec and choose a renderer:
spec = molplot.scatter_spec(pc1, pc2, color=cluster_id, colorscale="viridis")
fig, ax = molplot.render(spec)     # matplotlib (scienceplots)
molplot.to_png(spec, "fig.png")    # exact web parity via vl-convert (optional)
import json; json.dumps(spec)      # ship the same spec to the browser

line_spec / scatter_spec / bar_spec / gantt_spec emit the same Vega-Lite shapes as the TypeScript @molcrafts/molplot builders.

License

BSD-3-Clause

Metadata

Release files for molcrafts-molplot 0.1.7

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

Source distribution (sdist)

Source distribution for molcrafts-molplot 0.1.7
File Size Uploaded
molcrafts_molplot-0.1.7.tar.gz 59.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for molcrafts-molplot 0.1.7
File Interpreter ABI Platform
molcrafts_molplot-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 118.9 kB

Release files / molcrafts_molplot-0.1.7.tar.gz

Download URL molcrafts_molplot-0.1.7.tar.gz
Size 59.7 kB
Tags Source
SHA-256 checksum
How to use checksums
70e2f560e06cb1ce6bf2290f43b6ec7b70d0b335794b3160deeb14589b2b24e6
BLAKE2b-256 checksum
How to use checksums
b22f9458f5adc57455575a431b61a6593efd25bd15c7acf4068aa5438a33bb25
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 28, 2026.

Transparency log

Release files / molcrafts_molplot-0.1.7-py3-none-any.whl

Download URL molcrafts_molplot-0.1.7-py3-none-any.whl
Size 59.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ce31b2304e23026fd2e29e05d8929c9c9864d5b0e4e899341b6877069b180b6
BLAKE2b-256 checksum
How to use checksums
5a3dbe98f3e76cbb5f37e6a2bae8bd0f56b4007b0a8b85898e4933d7645fb3e1
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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