Skip to main content

Create custom table using matplotlib.

Project description

MPL Table

Create a table with row explanations, column headers, using matplotlib. Intended usage was a small table containing a custom heatmap.

Installation

pip install mpl-table

Usage

Example usage can be found within tests/test_create_table.py, the table is created by passing dataframes containing text values, cell colour values, and text colour values. You'll probably want to use bbox_inches="tight" when you fig.savefig.

Example output

Example output table.

Why

Wanted to be able to create tables containing heatmaps, along with row explanations and different treatment of high/low values for each row. For some rows the formatting of 100% should be considered positive (typically green), whereas others it should be considered negative (typically red).

TODO

Some additional examples of customisation. Currently the sizing of the output table isn't dynamic, for some tables one might have to adjust the figsize in order for things to fit well, and be mindful of the amount of text used in row meaning text column.

Usage within subplots, wasn't required for what was needed, but there could be some use in having subplots with these tables.

Different styles - might want to have the header row / row information column without any background colour, or similar stylings. Shouldn't be hard to do from what's here, just hasn't been done.

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_table-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

mpl_table-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpl_table-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.9 CPython/3.9.5 Darwin/20.6.0

File hashes

Hashes for mpl_table-0.1.0.tar.gz
Algorithm Hash digest
SHA256 96b3ba534b1e954e4a643699be2cfffba505c678974c6fbae28bb5b8b6cb9025
MD5 62697c0fa5c6d0a118dcf8acbe77dda8
BLAKE2b-256 614190a9991fc4a3b7e4450a95d8c6d8d64977f656f02da020bc2a5aa869907b

See more details on using hashes here.

File details

Details for the file mpl_table-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mpl_table-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.9 CPython/3.9.5 Darwin/20.6.0

File hashes

Hashes for mpl_table-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a3fa4aff1b354ae8c17dcbf3438f51059c3fd8867d5aa968e6d0f0b3cd5c8eb
MD5 9bd418cb27a493e6d71299c118a9674d
BLAKE2b-256 91ff4ad7b82410d3b42e6a7f3893009d78c60c0790d9dbf727854a4d75c39af4

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