{"id":27966251,"url":"https://github.com/mckinsey/qbstyles","last_synced_at":"2025-12-14T00:21:51.075Z","repository":{"id":57458830,"uuid":"169602018","full_name":"mckinsey/qbstyles","owner":"mckinsey","description":"QuantumBlack Matplotlib styles","archived":false,"fork":false,"pushed_at":"2024-07-10T11:27:18.000Z","size":1559,"stargazers_count":371,"open_issues_count":13,"forks_count":36,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-07T20:17:35.811Z","etag":null,"topics":["matplotlib","plotting","python","stylesheet"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mckinsey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-07T16:22:29.000Z","updated_at":"2025-04-14T15:05:40.000Z","dependencies_parsed_at":"2023-01-30T19:45:56.913Z","dependency_job_id":"a3bdcb2e-f387-497e-97d3-d5df5850ec99","html_url":"https://github.com/mckinsey/qbstyles","commit_stats":null,"previous_names":["quantumblacklabs/qbstyles"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckinsey%2Fqbstyles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckinsey%2Fqbstyles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckinsey%2Fqbstyles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckinsey%2Fqbstyles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mckinsey","download_url":"https://codeload.github.com/mckinsey/qbstyles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949246,"owners_count":21830154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matplotlib","plotting","python","stylesheet"],"created_at":"2025-05-07T20:17:41.484Z","updated_at":"2025-12-14T00:21:51.022Z","avatar_url":"https://github.com/mckinsey.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QB Styles\n\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Python Version](https://img.shields.io/pypi/pyversions/qbstyles.svg)](https://pypi.org/project/qbstyles/)\n[![PyPI version](https://badge.fury.io/py/qbstyles.svg)](https://pypi.org/project/qbstyles/)\n[![Code Style: Black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black)\n\nQB Styles is a python package with a light and a dark [`matplotlib`](https://github.com/matplotlib/matplotlib) style.\n\nDark style | Light style\n|-----------|----------- |\n| ![Line plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/line.png?raw=true \"Line plot\") | ![Distribution plot](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/distribution_light.png?raw=true \"Distribution plot\") |\n\n## How do I install QB Styles?\n\n`qbstyles` is a Python package. To install it, simply run:\n\n\n```bash\npip install qbstyles\n```\n\n## How do I use QB Styles?\n\nYou can use the dark Matplotlib style theme in the following way:\n\n```python\nfrom qbstyles import mpl_style\n\nmpl_style(dark=True)\n```\n\nAnd to use the light Matplotlib style theme, you can do the following: \n\n```python\nfrom qbstyles import mpl_style\n\nmpl_style(dark=False)\n```\n\n### How do I use QB Styles in Jupyter Notebooks?\n\n\u003e ⚠️ Please make sure you run `from qbstyles import mpl_style` and `mpl_style()` in **different cells** as shown below. See [this issue](https://github.com/jupyter/notebook/issues/3691) for more details.\n\n```python\n# first cell\nfrom qbstyles import mpl_style\n```\n```python\n# second cell\nmpl_style()\n```\n\n## What chart types can use QB Styles?\n\n- Line plots\n- Scatter plots\n- Bubble plots\n- Bar charts\n- Pie charts\n- Histograms and distribution plots\n- 3D surface plots\n- Stream plots\n- Polar plots\n\n## Can you show me a few examples?\n\nTo run the examples in [`example.ipynb`](https://github.com/quantumblacklabs/qbstyles/blob/master/example.ipynb), install the required packages using ``pip install -r requirements_notebook.txt`` in a Python virtual environment of your choice.\n\n```python\nimport matplotlib.pyplot as plt\nfrom qbstyles import mpl_style\n\ndef plot(dark):\n    mpl_style(dark)\n    fig, axes = plt.subplots(2, 2, figsize=(15, 10))\n    \n    # the following functions are defined in example.ipynb \n    line_plot(axes[0, 0])\n    scatter_plot(axes[0, 1])\n    distribution_plot(axes[1, 0])\n    ax = plt.subplot(2, 2, 4, projection='polar')\n    polar_plot(ax)\n\nplot(dark=True)\n```\n\n![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_6_0.png?raw=true)\n\n```python\nplot(dark=False)\n```\n\n![png](https://github.com/quantumblacklabs/qbstyles/raw/master/examples/output_7_0.png?raw=true)\n\n## How do I create my own styles? \n\nHave a look at the files [qb-common.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-common.mplstyle), [qb-dark.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-dark.mplstyle) and [qb-light.mplstyle](https://github.com/quantumblacklabs/qbstyles/blob/master/qbstyles/styles/qb-light.mplstyle). They contain many elements that you may want to customise.\n\nTo do so, create a file similar to the above files at the root of your project, and apply it after the `qbstyle` as follows:\n\n```python\nimport matplotlib.pyplot as plt\nfrom qbstyles import mpl_style\n\nmpl_style()\nplt.style.use('./your-style.mplstyle')\n```\n\nAll of `matplotlibrc`'s options can be found [here](https://matplotlib.org/tutorials/introductory/customizing.html#a-sample-matplotlibrc-file).\n\n## What licence do you use?\n\nQB Styles is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmckinsey%2Fqbstyles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmckinsey%2Fqbstyles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmckinsey%2Fqbstyles/lists"}