Skip to main content

plotynium is a Data Visualization framework for Python, inspired by Observable Plot

Project description

docs CI Ruff

Plotynium

Plotynium is a Data Visualization framework for Python, inspired by Observable Plot.

Installation

pip install git+https://github.com/bourbonut/plotynium

It will be available soon on Pypi.

Example

import polars as pl
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler

import plotynium as ply

mnist = load_digits()
scaler = StandardScaler()
X_scaled = scaler.fit_transform(mnist.data)
pca = PCA(n_components=2)
components = pca.fit_transform(X_scaled)

# Prepare your data with Polars, Pandas or manually
df = pl.DataFrame(components, schema=["Component 1", "Component 2"])
df = df.insert_column(2, pl.Series("digit", mnist.target))

plot = ply.plot(
    marks=[
        ply.dot(
            df.to_dicts(),
            x="Component 1",
            y="Component 2",
            stroke="digit",
            symbol="digit",
        )
    ],
    color={"scheme": ply.Interpolation.RAINBOW},
    symbol={"legend": True},
    style={"background": "#0d1117", "color": "#e6edf3"},
)

with open("pca.svg", "w") as file:
    file.write(str(plot))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotynium-0.1.0.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotynium-0.1.0-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file plotynium-0.1.0.tar.gz.

File metadata

  • Download URL: plotynium-0.1.0.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for plotynium-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5215915bf2819a789516196b9848665799a8c9f711ced54760b2e54c1ff228e2
MD5 b66bfd852a572f3a8f713f21e72414dd
BLAKE2b-256 42e9a47afa270d46d528a9811e7ce2a37e26694d29e0cfd879455a4cbfc9894f

See more details on using hashes here.

File details

Details for the file plotynium-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plotynium-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for plotynium-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13f5d5b22daaed693202653f65dd1b5b12246ff9610d1306ec8e23751521d428
MD5 9bdfa0c69a14863c612374009911d024
BLAKE2b-256 ffbca39ba2737b5ecc6221c0c4500d1873a1bdbf638653e430b1c9e09b1e93cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page