datarootsio / rootsstyle

A dataroots inspired style for Matplotlib. Works with any visualization tools that builds upon Matplotlib (seaborn, pandas).
MIT License
3 stars 0 forks source link

dataroots PyPI version Python Versions codecov semantic-release: angular

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

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

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.