Skip to main content

A dataroots inspired theme for matplotlib.

Project description

dataroots PyPI version Python Versions codecov semantic-release: angular

rootsstyle

A matplotlib styling package for clean, minimal dataroots themed plots. Works with any visualization tools that builds upon Matplotlib (seaborn, pandas).

Installation

using pip

pip install rootsstyle

using poetry

poetry add rootsstyle

Usage

Examples

import rootsstyle
import matplotlib.pyplot as plt

plt.style.use(rootsstyle.style)
y, y2 = [3, 8, 1, 10], [8, 3, 10, 2]
plt.plot(y, label='y')
plt.plot(y2, label='y2', linestyle = 'dotted')
rootsstyle.ylabel('yvalues')
plt.xlabel('x-label')
rootsstyle.legend()
plt.title('Example plot')
plt.show()
import rootsstyle
import matplotlib.pyplot as plt

plt.style.use(rootsstyle.style)
languages = ['C', 'C++', 'Java', 'Python', 'PHP']
students = [23,17,35,29,12]
plt.bar(languages, students)
plt.xlabel('Language')
rootsstyle.show_bar_values()
plt.title('Example barplot')
plt.show()

STYLING

import rootsstyle
import matplotlib.pyplot as plt

# globally
plt.style.use(rootsstyle.style)

# within context manager
with plt.style.context(rootsstyle.style):
    # ...

FUNCTIONS

  • Place the legend to the right of the plot.
    For lineplots, place the legend entries right of the corresponding line.

    rootsstyle.legend(handles=None, labels=None, title=None)
    
  • Place the y-label above the y-axis and rotate it, so that it is horizontal.

    rootsstyle.ylabel(ylabel: str)
    
  • Show barvalues at each bar.
    Removes the y-axis (optional).
    Bar values can be shown just 'below' the top of each bar, or just 'above' each bar.

    rootsstyle.show_bar_values(remove_y_axis=True, fontsize=12, position="below", fmt="{:.0f}")
    

COLOR PALETTE

The color palettes are added to the global matplotlib color registry. You can thus easily use a palette by simply providing the name in the correct location.

VERSIONING

A semantic versioning scheme is used to update the version on the commit messages. This happens automatically on any push to the main branch. Only patches, minor and major changes will generate a tag, release and publishing of the package. We stick to the default Angular Commit Message Conventions. To use this system, commit messages should adhere to a couple of rules:

  1. Commits must follow the following syntax

    <type>(<scope>): <subject>
    <BLANK LINE>
    <body>
    <BLANK LINE>
    <footer>
    
  2. Type should be one of the following:

    • feat: A new feature
    • fix: A bug fix
    • docs: Documentation only changes
    • style: Changes that do not affect the meaning of the code (formatting, missing semi-colons, etc)
    • refactor: A code change that neither fixes a bug nor adds a feature
    • perf: A code change that improves performance
    • test: Adding missing or correcting existing tests
    • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
  3. Body (optional) is used to motivate the change

  4. Footer (optional) is used to link to any issues that the commit closes and for breaking changes, in which case the line should start with BREAKING CHANGE:.

CHANGELOG

The CHANGELOG.md file is automatically updated upon any new releases.

License

This project is licensed under the terms of the MIT license.

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

rootsstyle-0.5.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

rootsstyle-0.5.1-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file rootsstyle-0.5.1.tar.gz.

File metadata

  • Download URL: rootsstyle-0.5.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.12 Linux/5.11.0-1028-azure

File hashes

Hashes for rootsstyle-0.5.1.tar.gz
Algorithm Hash digest
SHA256 0e9971a7de88ee8716ceae44a3df216195ef8ccef435dc6736814e4d47c4d070
MD5 c18eae48fa2d8dde0742a473e496d992
BLAKE2b-256 0c76e9591091e05710eee20f297bc1238804f3482aff318438d1c40b0fcb8537

See more details on using hashes here.

File details

Details for the file rootsstyle-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: rootsstyle-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.12 Linux/5.11.0-1028-azure

File hashes

Hashes for rootsstyle-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 697c76e32297009940aeb140cbd326f9d1d7e4a23acd44805feb8d678a33140f
MD5 47625275c65f5035ac1f6eb48e81e5c3
BLAKE2b-256 90dc25676b7df9d28bc7592819605700a6aa795e02981df5fc422bcc779672b2

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