Skip to main content

ING styles for common plotting libraries

Project description

ING Style Plotting

License

ing_theme_matplotlib is a python package with a light and a dark matplotlib style that allows you to create your plots using ING colors. It was adapted from the qbstyles package.

Dark style Light style
Scatter plot Distribution plot

How to install ing_theme_matplotlib

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

pip install ing_theme_matplotlib

How to use ING Style Plotting

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

from ing_theme_matplotlib import mpl_style
mpl_style(dark=True)

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

from ing_theme_matplotlib import mpl_style
mpl_style(dark=False)

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

How to add ING Logo to the plots

Assume that below is the function we use for plotting;

def line_plot(ax):
    rng = np.random.RandomState(4)
    x = np.linspace(0, 10, 500)
    y = np.cumsum(rng.randn(500, 4), 0)
    ax.set_title('Line Graph')
    ax.set_xlabel('— Time')
    ax.set_ylabel('— Random values')
    ax.plot(x, y, label = ['Bitcoin', 'Ethereum', 'Dollar', 'Oil'])
    ax.legend(['Bitcoin', 'Ethereum', 'Dollar', 'Oil'], loc = 1, fontsize = 'medium')
    ax.set_xlim([0, 10])
    ax.set_ylim([-20, 60])
    ax.figure.set_figwidth(16)
    ax.figure.set_figheight(8)
    ax.spines['right'].set_position(('axes', 1.05))
    ax.spines['right'].set_color('none')

You can add the default ing logo to your plot by calling add_logo function inside the plotting function.

from ing_theme_matplotlib.ing_theme.mpl_style import add_logo
mpl_style()
line_plot(add_logo())

png

You can also add custom logos to your plot by giving the path where the image is located.

from ing_theme_matplotlib.ing_theme.mpl_style import add_logo
mpl_style(dark = False)
line_plot(add_logo(bottom_left = 'logos/RPAA_Logo_RGB_Line.png'))

png

For more examples, you can check out the ExamplePlots.ipynb file.

What chart types can be used with ing_theme_matplotlib?

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

What licence do we use?

ING Style plotting 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

ing_theme_matplotlib-0.1.0.tar.gz (150.5 kB view details)

Uploaded Source

File details

Details for the file ing_theme_matplotlib-0.1.0.tar.gz.

File metadata

  • Download URL: ing_theme_matplotlib-0.1.0.tar.gz
  • Upload date:
  • Size: 150.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for ing_theme_matplotlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d322f40e458e254673a40ac1fcb1d08fcea1ccb949b40040101535d6c43f792e
MD5 e57cd1430cdffaed7e3634837182e4c8
BLAKE2b-256 3c975e531cabed1a9c2804a875134495a0f470a9fe98951e9a08239a178c0132

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