Skip to main content

QB styles for common plotting libraries

Project description

QB Styles

License Python Version PyPI version Code Style: Black

QB Styles is a python package with a light and a dark matplotlib style.

Dark style Light style
Line plot Distribution plot

How do I install QB Styles?

qbstyles is a Python package. To install it, simply run:

pip install qbstyles

How do I use QB Styles?

You can use the dark Matplotlib style theme in the following way:

from qbstyles import mpl_style

mpl_style(dark=True)

And to use the light Matplotlib style theme, you can do the following:

from qbstyles import mpl_style

mpl_style(dark=False)

How do I use QB Styles in Jupyter Notebooks?

⚠️ Please make sure you run from qbstyles import mpl_style and mpl_style() in different cells as shown below. See this issue for more details.

# first cell
from qbstyles import mpl_style
# second cell
mpl_style()

What chart types can use QB Styles?

  • Line plots
  • Scatter plots
  • Bubble plots
  • Bar charts
  • Pie charts
  • Histograms and distribution plots
  • 3D surface plots
  • Stream plots
  • Polar plots

Can you show me a few examples?

To run the examples in example.ipynb, install the required packages using pip install -r requirements_notebook.txt in a Python virtual environment of your choice.

import matplotlib.pyplot as plt
from qbstyles import mpl_style

def plot(dark):
    mpl_style(dark)
    fig, axes = plt.subplots(2, 2, figsize=(15, 10))

    # the following functions are defined in example.ipynb 
    line_plot(axes[0, 0])
    scatter_plot(axes[0, 1])
    distribution_plot(axes[1, 0])
    ax = plt.subplot(2, 2, 4, projection='polar')
    polar_plot(ax)

plot(dark=True)

png

plot(dark=False)

png

How do I create my own styles?

Have a look at the files qb-common.mplstyle, qb-dark.mplstyle and qb-common.mplstyle. They contain many elements that you may want to customise.

To do so, create a file similar to the above files at the root of you project, and apply it after the qbstyle as follows:

import matplotlib.pyplot as plt
from qbstyles import mpl_style

mpl_style()
plt.style.use('./your-style.mplstyle')

All of matplotlibrc's options can be found here.

What licence do you use?

QB Styles is licensed under the Apache 2.0 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

qbstyles-0.1.2.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

qbstyles-0.1.2-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file qbstyles-0.1.2.tar.gz.

File metadata

  • Download URL: qbstyles-0.1.2.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for qbstyles-0.1.2.tar.gz
Algorithm Hash digest
SHA256 325d1ee8df0cc0828c70c1719cfd8ad307089653892f4fec5f102ba9939ff387
MD5 2e5ee00c35cac779aaeac4460609b969
BLAKE2b-256 d110295a8f4acf879b67300afb41f4be2fcf18e7bccecd4835f6c5eee7b1fa37

See more details on using hashes here.

File details

Details for the file qbstyles-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: qbstyles-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for qbstyles-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 236c3e801900b7172cc3c88a8a4cb6bc4ad9bdc4d9b9133d166ac5c81fed0941
MD5 4813e16b39273a0e0d419061cb0e579b
BLAKE2b-256 8b5e16b5c7d073058c18e6c2342298b73c8b38fa2449ec0d589319ac0b00cc58

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