Giter VIP home page Giter VIP logo

qbstylesfork's Introduction

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-light.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 your 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.

qbstylesfork's People

Contributors

bartekszpak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.