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
Table with row headers:
Table with no row headers:
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
Built Distribution
File details
Details for the file mpl_table-0.1.5.tar.gz
.
File metadata
- Download URL: mpl_table-0.1.5.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.9 CPython/3.9.5 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4734d33df687f306c075f5bf414f3ac00c728023d646508bbd1b8e4185aebaa3 |
|
MD5 | a82aa6e8ac78781f144eeee649a1439c |
|
BLAKE2b-256 | 39f76db1bb91f7e5af28febd9bc3581064fe264dbbd01fd5b4642eb3ab251114 |
File details
Details for the file mpl_table-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: mpl_table-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bceb7a7d4f5c7fa41f275d4da8e467ab5ee6a8f6caf40b7ecce8d1988dc82776 |
|
MD5 | aff3bedf7fa39bc7b51ee9248b802078 |
|
BLAKE2b-256 | 5d469433d3bd92ebe40e61aed90d72af8818467beb0989e85d53f66776e29904 |