statworx_theme


Namestatworx_theme JSON
Version 2.0.2 PyPI version JSON
download
home_pagehttps://statworx-theme.readthedocs.io/en/latest
SummaryA color theme for matplotlib using the offical statworx design
upload_time2024-08-27 16:26:46
maintainerNone
docs_urlNone
authorstatworx Team
requires_python<4.0,>=3.9
licenseMIT
keywords theme matplotlib plotting statworx
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Statworx Theme

[![PyPI version](https://badge.fury.io/py/statworx-theme.svg)](https://badge.fury.io/py/statworx-theme)
[![Documentation Status](https://readthedocs.org/projects/statworx-theme/badge/?version=latest)](https://statworx-theme.readthedocs.io/en/latest/?badge=latest)
[![Release](https://github.com/STATWORX/statworx-theme/actions/workflows/release.yml/badge.svg)](https://github.com/STATWORX/statworx-theme/actions/workflows/release.yml)
[![Code Quality](https://github.com/STATWORX/statworx-theme/actions/workflows/conde_quality.yml/badge.svg)](https://github.com/STATWORX/statworx-theme/actions/workflows/conde_quality.yml)
[![Python version](https://img.shields.io/badge/python-3.8-blue.svg)](https://pypi.org/project/kedro/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/STATWORX/statworx-theme/blob/master/LICENSE)
![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)

A color theme plugin for the [matplotlib](https://matplotlib.org/) library and all its derivatives, as well as an optional adaption of this theme for [altair](https://altair-viz.github.io/) and [plotly](https://plotly.com/python/), which automatically applies the official statworx color theme.
This package also registers commonly used [qualitative color maps](https://matplotlib.org/stable/tutorials/colors/colormaps.html) (such as a fade from good to bad) for use in presentations.

![Sample](./docs/assets/sample.svg)

## Quick Start

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

```console
pip install statworx-theme
```

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

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

For using the styles inside a poetry managed project use `poetry add` with extras.
```console
#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:

```python
from statworx_theme import apply_style
apply_style()
```

For applying the plotly or altair style the respective `apply_style_<library>` function is used:
```python
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](https://statworx-theme.readthedocs.io/en/latest/gallery.html).
For a figure gallery using the altair and plotly theme see the respective notebooks inside the [repository](https://github.com/STATWORX/statworx-theme/tree/master/notebooks).

![Sample](./docs/assets/gallery.png)

## 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](https://matplotlib.org/stable/tutorials/introductory/customizing.html)).

```python
from statworx_theme import apply_custom_colors

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

#### Altair

```python
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

```python
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)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://statworx-theme.readthedocs.io/en/latest",
    "name": "statworx_theme",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "theme, matplotlib, plotting, statworx",
    "author": "statworx Team",
    "author_email": "accounts@statworx.com",
    "download_url": "https://files.pythonhosted.org/packages/d0/fd/3fb9d89efd08d8f3ad0df322f00e5c16a33ac28c6c0089e40c8ebba801fa/statworx_theme-2.0.2.tar.gz",
    "platform": null,
    "description": "# Statworx Theme\n\n[![PyPI version](https://badge.fury.io/py/statworx-theme.svg)](https://badge.fury.io/py/statworx-theme)\n[![Documentation Status](https://readthedocs.org/projects/statworx-theme/badge/?version=latest)](https://statworx-theme.readthedocs.io/en/latest/?badge=latest)\n[![Release](https://github.com/STATWORX/statworx-theme/actions/workflows/release.yml/badge.svg)](https://github.com/STATWORX/statworx-theme/actions/workflows/release.yml)\n[![Code Quality](https://github.com/STATWORX/statworx-theme/actions/workflows/conde_quality.yml/badge.svg)](https://github.com/STATWORX/statworx-theme/actions/workflows/conde_quality.yml)\n[![Python version](https://img.shields.io/badge/python-3.8-blue.svg)](https://pypi.org/project/kedro/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/STATWORX/statworx-theme/blob/master/LICENSE)\n![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)\n\nA color theme plugin for the [matplotlib](https://matplotlib.org/) library and all its derivatives, as well as an optional adaption of this theme for [altair](https://altair-viz.github.io/) and [plotly](https://plotly.com/python/), which automatically applies the official statworx color theme.\nThis package also registers commonly used [qualitative color maps](https://matplotlib.org/stable/tutorials/colors/colormaps.html) (such as a fade from good to bad) for use in presentations.\n\n![Sample](./docs/assets/sample.svg)\n\n## Quick Start\n\nSimply install a module with `pip` by using the following command.\n\n```console\npip install statworx-theme\n```\n\nFor usage of altair and plotly extra dependencies need to be installed using pip.\n\n```console\npip install \"statworx-theme[altair]\"\npip install \"statworx-theme[plotly]\"\n```\n\nFor using the styles inside a poetry managed project use `poetry add` with extras.\n```console\n#only matplotlib\npoetry add statworx-theme\n\n# altair theme\npoetry add statworx-theme -E \"altair\"\n\n# plotly theme\npoetry add statworx-theme -E \"plotly\"\n\n# Whole package\npoetry add statworx-theme -E \"altair plotly\"\n```\n\n\nTo apply the matplotlib style, you must call the `apply_style` function by typing:\n\n```python\nfrom statworx_theme import apply_style\napply_style()\n```\n\nFor applying the plotly or altair style the respective `apply_style_<library>` function is used:\n```python\nfrom statworx_theme import apply_style_altair, apply_style_plotly\napply_style_altair()\napply_style_plotly()\n```\n\n\n## Gallery\n\n#### Matplotlib\nThere is an extensive gallery of figures that use the Statworx theme that you can draw inspiration from. You can find it [here](https://statworx-theme.readthedocs.io/en/latest/gallery.html).\nFor a figure gallery using the altair and plotly theme see the respective notebooks inside the [repository](https://github.com/STATWORX/statworx-theme/tree/master/notebooks).\n\n![Sample](./docs/assets/gallery.png)\n\n## Custom Colors\n\nYou can also use a custom list of color for the color scheme beside the official statworx colors.\nThere is a convenience function for that which is described below.\nThis simply changes the colors.\n\n##### Matplotlib\nIn case you want to change the entire style you should implement your own `.mplstyle` file (see [this](https://matplotlib.org/stable/tutorials/introductory/customizing.html)).\n\n```python\nfrom statworx_theme import apply_custom_colors\n\ncustom_colors = [\n    DARK_BLUE := \"#0A526B\",\n    DARK_RED := \"#6B0020\",\n    GREY := \"#808285\",\n]\napply_custom_colors(custom_colors)\n```\n\n#### Altair\n\n```python\nfrom statworx_theme import apply_custom_colors_altair\n\ncustom_colors = [\n    DARK_BLUE := \"#0A526B\",\n    DARK_RED := \"#6B0020\",\n    GREY := \"#808285\",\n]\napply_custom_colors_altair(category=custom_colors)\n```\n\n#### Plotly\n\n```python\nfrom statworx_theme import apply_custom_colors_plotly\ncustom_colors = [\n    DARK_BLUE := \"#0A526B\",\n    DARK_RED := \"#6B0020\",\n    GREY := \"#808285\",\n]\napply_custom_colors_plotly(category=custom_colors)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A color theme for matplotlib using the offical statworx design",
    "version": "2.0.2",
    "project_urls": {
        "Homepage": "https://statworx-theme.readthedocs.io/en/latest",
        "Repository": "https://github.com/STATWORX/statworx-theme"
    },
    "split_keywords": [
        "theme",
        " matplotlib",
        " plotting",
        " statworx"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2bb0f4e17cbea6ae7a8ad5646c922a5e989e2d4f52cba49f64b9c661e491f546",
                "md5": "193a3ee726ae855ea320c3a62ddeacc7",
                "sha256": "92a2e4599b84d21a2a0d0b11a0708c0ad364ac277af6991c5d63ec406c390a26"
            },
            "downloads": -1,
            "filename": "statworx_theme-2.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "193a3ee726ae855ea320c3a62ddeacc7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 21361,
            "upload_time": "2024-08-27T16:26:45",
            "upload_time_iso_8601": "2024-08-27T16:26:45.216284Z",
            "url": "https://files.pythonhosted.org/packages/2b/b0/f4e17cbea6ae7a8ad5646c922a5e989e2d4f52cba49f64b9c661e491f546/statworx_theme-2.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0fd3fb9d89efd08d8f3ad0df322f00e5c16a33ac28c6c0089e40c8ebba801fa",
                "md5": "3cbb7becded97ab99dbbee3133af68b9",
                "sha256": "f27de266bd1d7b899da02a9bb03cf179b71d7fa33869f61179c8d6ecc3671865"
            },
            "downloads": -1,
            "filename": "statworx_theme-2.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3cbb7becded97ab99dbbee3133af68b9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 22092,
            "upload_time": "2024-08-27T16:26:46",
            "upload_time_iso_8601": "2024-08-27T16:26:46.493191Z",
            "url": "https://files.pythonhosted.org/packages/d0/fd/3fb9d89efd08d8f3ad0df322f00e5c16a33ac28c6c0089e40c8ebba801fa/statworx_theme-2.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-27 16:26:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "STATWORX",
    "github_project": "statworx-theme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "statworx_theme"
}
        
Elapsed time: 4.58591s