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.4

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.4
File Size Uploaded
molcrafts_molplot-0.1.4.tar.gz 29.0 kB Details

Built distribution (wheel)

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

Total release size: 62.2 kB

Release files / molcrafts_molplot-0.1.4.tar.gz

Download URL molcrafts_molplot-0.1.4.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
be1b8fd422e440881ace16177ed9165c936de6eecc6370b304c8d0af8160dd4c
BLAKE2b-256 checksum
How to use checksums
7751e37c2478d5f32229b7cc29861303f9620e8bfca8dba8edfaea6220e43e9b
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 Aug 5, 2026.

Transparency log

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

Download URL molcrafts_molplot-0.1.4-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3050dbea5bfbbc97a8bb9fcb809d4821a6831ce2ac117142a1de96132dc05221
BLAKE2b-256 checksum
How to use checksums
c77c1fbf39c3b85876d69a506786b5c636d2647a5a8306a43201ce2a7e9df6e0
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 Aug 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

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