Skip to main content

Statworx Theme

[!WARNING] This package is deprecated and is no longer being developed or maintained.

statworx-theme will receive no further updates, bug fixes, or support, and no new releases are planned. The package remains available on PyPI for existing users, but we recommend migrating away from it. Feel free to fork the repository if you wish to continue development independently.

PyPI version Documentation Status Release Code Quality Python version License: MIT pre-commit

A color theme plugin for the matplotlib library and all its derivatives, as well as an optional adaption of this theme for altair and plotly, which automatically applies the official statworx color theme. This package also registers commonly used qualitative color maps (such as a fade from good to bad) for use in presentations.

Sample

Quick Start

Simply install a module with pip by using the following command.

pip install statworx-theme

For usage of altair and plotly extra dependencies need to be installed using pip.

pip install "statworx-theme[altair]"
pip install "statworx-theme[plotly]"

For using the styles inside a poetry managed project use poetry add with extras.

#only matplotlib
poetry add statworx-theme

# altair theme
poetry add statworx-theme -E "altair"

# plotly theme
poetry add statworx-theme -E "plotly"

# Whole package
poetry add statworx-theme -E "altair plotly"

To apply the matplotlib style, you must call the apply_style function by typing:

from statworx_theme import apply_style
apply_style()

For applying the plotly or altair style the respective apply_style_<library> function is used:

from statworx_theme import apply_style_altair, apply_style_plotly
apply_style_altair()
apply_style_plotly()

Gallery

Matplotlib

There is an extensive gallery of figures that use the Statworx theme that you can draw inspiration from. You can find it here. For a figure gallery using the altair and plotly theme see the respective notebooks inside the repository.

Sample

Custom Colors

You can also use a custom list of color for the color scheme beside the official statworx colors. There is a convenience function for that which is described below. This simply changes the colors.

Matplotlib

In case you want to change the entire style you should implement your own .mplstyle file (see this).

from statworx_theme import apply_custom_colors

custom_colors = [
    DARK_BLUE := "#0A526B",
    DARK_RED := "#6B0020",
    GREY := "#808285",
]
apply_custom_colors(custom_colors)

Altair

from statworx_theme import apply_custom_colors_altair

custom_colors = [
    DARK_BLUE := "#0A526B",
    DARK_RED := "#6B0020",
    GREY := "#808285",
]
apply_custom_colors_altair(category=custom_colors)

Plotly

from statworx_theme import apply_custom_colors_plotly
custom_colors = [
    DARK_BLUE := "#0A526B",
    DARK_RED := "#6B0020",
    GREY := "#808285",
]
apply_custom_colors_plotly(category=custom_colors)

Metadata

Release files for statworx_theme 2.0.3

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

Source distribution (sdist)

Source distribution for statworx_theme 2.0.3
File Size Uploaded
statworx_theme-2.0.3.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for statworx_theme 2.0.3
File Interpreter ABI Platform
statworx_theme-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 43.9 kB

Release files / statworx_theme-2.0.3.tar.gz

Download URL statworx_theme-2.0.3.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f9ff3bb71de8fb5aafdccda2bcef06c15fde5dfc8b65650624f3f58362b5ec52
BLAKE2b-256 checksum
How to use checksums
9657b88469002c1258218e5b731ee2b5ab8892a3c3082f3f1856a7fe4cca9a95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1018-azure

Release files / statworx_theme-2.0.3-py3-none-any.whl

Download URL statworx_theme-2.0.3-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
135bea4a85a9f4d7a3731bf171fddcd36c0659d130c51c05e81cc46391ca8023
BLAKE2b-256 checksum
How to use checksums
e0f60ed977886ce715897b387d2ef52c83fa2c4f79bbc661bed9361ffc6d6dae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1018-azure

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.2

2 release files

0.13.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

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