Skip to main content

BSIC Plotting Library

Project description


Logo

mpl-bsic

Create matplotlib plots in BSIC Style!

Explore the docs »

Report Bug - Request Feature

Contributors Issues License

About the Project

Plot Example

This package allows you to style matplotlib plots using BSIC Style (fonts, colors, logos, etc.) to later use them in BSIC articles. It also provides utility function to handle the formatting of the axis, check the size of the figures, and more!

Read the sections below for an overview of how to install and use the package. For further information, be sure to read the docs!

Table Of Contents

Installation

The package supports all python versions starting from 3.9.0

To install, run

pip install mpl-bsic

Then you can import the functions from the module, for example

from mpl_bsic import apply_bsic_style

Docs and TLDR

Read the docs on this link. All the functions are explained extensively and you can find example code/plots.

WARNING: Be sure to read the docs for apply_bsic_style, and in particular how to make sure the style gets applied. You always have to make sure you call plt.show() (if in a script) even if you only plan to export the plot, since otherwise matplotlib won't run the animations which are required to apply the style to the title. And also read carefully the part about the figsize to use, especially when exporting to use in a Word file.

A brief overview of the functions of the module:

  • apply_bsic_style: applies the BSIC styles to a plot (font families, font sizes).
  • apply_bsic_logo: applies the BSIC logo to the plot. You can specify the size, location and logo type.
  • check_figsize: checks the figsize of your plot, to make sure it will be rendered correctly in MS Word. To learn more about this, look at the documentation
  • format_timeseries_axis: formats the x axis of a timeseries plot. You can specify the time unit (yearly, monthly, daily), the frequency (e.g. a tick every 3M), and the format (e.g. MM/YYYY or MMM YYYY)
  • preprocess_dataframe: preprocesses a dataframe, by setting the index to the date (and converting to datetime) and transforming all the columns to lowercase for easier use in the project
  • plot_trade: WIP

If the matplotlib fonts do not work

Check the full guide on the documentation. Anyway, you need to install Garamond and Gill Sans MT on your system and clear your matplotlib cache.

Contributing

If you have any ideas, features you would like to have implemented, or you find out any bugs within the function, be sure to open an issue and I will work on it as soon as possible. Or you can also fork the repo yourself and make a pull request to the project!

Roadmap

  1. plot trade (as bloomberg with last price and stuff)
  2. plot tables (instead of having to style them using Excel)

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

mpl_bsic-1.2.1.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

mpl_bsic-1.2.1-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

Details for the file mpl_bsic-1.2.1.tar.gz.

File metadata

  • Download URL: mpl_bsic-1.2.1.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for mpl_bsic-1.2.1.tar.gz
Algorithm Hash digest
SHA256 d5de3e8bb0b10c14ce9c87b1fa29a2809252e44a701a49bbc0e90b75aa8e304e
MD5 1dbb523d28d59a638605df5d4a27fc5d
BLAKE2b-256 cd9bff500e6a7ebf07c3ef4bdf210961d151afac5a3c57a8c3ad6ff21b417a86

See more details on using hashes here.

Provenance

File details

Details for the file mpl_bsic-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: mpl_bsic-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for mpl_bsic-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 400f79aee8c5ae51f13150523157e108b343ee29a510f1cf990b199e2032ba86
MD5 d6c8e3ddfc71876c4b9cfc7c2298a980
BLAKE2b-256 417b78654d9bd4113a9a4d4bcbe48ac36c1463765d71c3c47c4ad6b6ea986b59

See more details on using hashes here.

Provenance

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