Skip to main content

kx-plot

One-line matplotlib plots and themes for notebooks and scripts.

kx is a small, plain-Python package with .mplstyle themes, palettes and colourmaps. It needs nothing beyond matplotlib, numpy and pandas and works offline, so it also runs in Kaggle competition notebooks.

dark theme

Install

pip install kx-plot
import kx; kx.use('dark')

Kaggle

With internet off (competition notebooks), attach the dataset instead (Add Input → Datasets → vhrabar/kx-plot), then:

import sys; sys.path.append('/kaggle/input/datasets/vhrabar/kx-plot')
import kx; kx.use('dark')

Usage

kx.use('light', palette='okabe', cmap='cividis')   # notebook default: theme, palette, colormap
kx.plot(x, y, z, 'scatter-grid-leg')               # spec: kind-theme-flag-...
kx.plot(x, y, 'bar-paper')                         # a theme in the spec applies to this plot only
Token Values
kind line step area band scatter bar hist
theme dark light paper science talk poster thesis
flags grid leg logx logy tight, plus stack norm for area

Unknown tokens raise an error instead of being guessed. Everything is inspectable: kx.grammar(), kx.grammar('area'), kx.show('dark'), kx.source('scatter').

rcParams can be overridden in kx.use with __ for dots: kx.use('dark', figure__figsize=(8, 4)).

Palettes

Palettes for kx.use(theme, palette=...), they swap only the colours; a theme's other cycled properties (such as paper's linestyles) stay.

Name Source
okabe Okabe & Ito (2008)
tolbright tolvibrant tolhc tolmc Paul Tol
petroff6 petroff8 petroff10 Petroff (2021)
tab10 tableaucb Tableau
set2 dark2 ColorBrewer
ibm IBM Design Colors

kx.palette('okabe') returns the hex codes. A list of colours works too: palette=['#264653', '#e9c46a'].

Colourmaps

Colourmaps for kx.use(theme, cmap=...) colour continuous values, such as a numeric z in scatter. Without cmap, the theme's own default applies.

Name Type
viridis magma plasma inferno cividis Sequential, perceptually uniform
turbo Sequential, rainbow
coolwarm Diverging
berlin managua vanimo Diverging, dark centre
twilight Cyclic, for angles and phases

kx.cmaps() lists the ones that are available in the installed matplotlib as those implemented in matplotlib 3.10 or newer are not vendored.

License

Released under the MIT License. See LICENSE.

Copyright © 2026 Vedran Hrabar

Vendored palettes keep their own licences; see kx/styles/palettes/LICENCES.md.

Metadata

Release files for kx-plot 0.1.0

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

Source distribution (sdist)

Source distribution for kx-plot 0.1.0
File Size Uploaded
kx_plot-0.1.0.tar.gz 36.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kx-plot 0.1.0
File Interpreter ABI Platform
kx_plot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.1 kB

Release files / kx_plot-0.1.0.tar.gz

Download URL kx_plot-0.1.0.tar.gz
Size 36.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0104bb04cd9d5b5d2db7539f7704e88c9c333dd06a736acf11fd2b48b47fb926
BLAKE2b-256 checksum
How to use checksums
0ecaaad8c92d8c366fe9ee8991df23b078c2dc2d9d9d5254881253441f58a9c0
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 Oct 8, 2026.

Transparency log

Release files / kx_plot-0.1.0-py3-none-any.whl

Download URL kx_plot-0.1.0-py3-none-any.whl
Size 47.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0f236f2249ccb29a212ba7194474a6d37211a554a22e74e48c17d90464d3a52
BLAKE2b-256 checksum
How to use checksums
c0c5c09c7c7d7ea04081b280ac06558fda95991a432ba0783492d7bfbdca7eea
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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

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