opinionated provides simple, clean stylesheets for plotting with matplotlib and seaborn.
Project description
opinionated provides simple, clean stylesheets for plotting with matplotlib and seaborn.
It’s modeled and named after hrbrthemes in R, by hrbrmstr, which are “Opinionated, typographic-centric ggplot2 themes”. It’s not meant to be an exact clone though, I have made a few different choices.
The main application I had in mind was to increase the quality of plots in colab-environments, where there is a very small range of preinstalled fonts. The package therefore automatically downloads fonts from GoogleFonts. But I think everything should also work on your local machine. Be aware though, that it’s not super well-tested, and might e. g. fail with facets.
Installation
pip install opinionated
Usage
The package is very simple to use, you just import it and set the style you want:
import opinionated plt.style.use("opinionated_rc")
Then you do your plotting:
f, ax = plt.subplots(figsize=(10, 7)) sns.scatterplot(x="bill_length_mm", y="flipper_length_mm", hue='species', data=penguins, s=100, alpha=0.9)
And finally, you can slap on some additional information, using some convenience functions with reasonable defaults. Of course, the usual ways of setting titles, legends, etc. still work.
opinionated.add_legend(title='Species') opinionated.add_attribution('by Maximilian Noichl') opinionated.set_title_and_suptitle('Penguins!','They are an excellent type of bird!')
Here’s the result:
This certainly does look better than what the defaults would give you, right? –
You can find more options, stylesheets, etc. in the github-repository!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file opinionated-0.0.2.7.tar.gz
.
File metadata
- Download URL: opinionated-0.0.2.7.tar.gz
- Upload date:
- Size: 25.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b3c47e45f8fb750eef86c7e1f32d06fe6425c9090a01eebfca245edb8b224e4 |
|
MD5 | 462370ea11d6b977acfe6e7ce5dffee1 |
|
BLAKE2b-256 | 91002786b589d94fe5293e5f7aebdbdab1a2859d28bea63c7bb91baae472bcbf |
File details
Details for the file opinionated-0.0.2.7-py3-none-any.whl
.
File metadata
- Download URL: opinionated-0.0.2.7-py3-none-any.whl
- Upload date:
- Size: 16.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe6d9310da9c7723563ff64d6c27d02432369a5253ad2e458233dce4bc5245ff |
|
MD5 | 52ddde0afb6b5244433bf389b15a018a |
|
BLAKE2b-256 | e23443af59e628e25597825c919c290a0ad9a80f375587a10bdde2488929b713 |