Skip to main content

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:

img

This certainly does look better than what the defaults would give you, right? –

img

You can find more options, stylesheets, etc. in the github-repository!

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

opinionated-0.0.3.0.tar.gz (27.0 MB view details)

Uploaded Source

Built Distribution

opinionated-0.0.3.0-py3-none-any.whl (16.1 MB view details)

Uploaded Python 3

File details

Details for the file opinionated-0.0.3.0.tar.gz.

File metadata

  • Download URL: opinionated-0.0.3.0.tar.gz
  • Upload date:
  • Size: 27.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for opinionated-0.0.3.0.tar.gz
Algorithm Hash digest
SHA256 27b96b1e08278310aa2a4a803fa54d5a9ab97b0cecf103e680ece8e131606b3e
MD5 e786f4284d3473337757e4e10d10de2d
BLAKE2b-256 d2a9e6aa9f366dad33df47b2ee98a361cbe3534017d89b1026c4478f682d1232

See more details on using hashes here.

File details

Details for the file opinionated-0.0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opinionated-0.0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4710db764a1250bfc45e4696e3f61a3f2def44de5b016effa6458b2bee0edca5
MD5 6527183b1089a2bb24c910474906e666
BLAKE2b-256 34b778eddd5c5e6fa9d6fdc6ff82c42c811f3f9d4d7404887aafe615672a3569

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page