Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPL Table

PyPI Latest Release Code style: black License

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. A difference with many plotting libraries is that configuration is done using a config object, rather than having lots of kwargs in the function call. When writing the plot out you'll probably want to use bbox_inches="tight" with fig.savefig.

Example output

Table with row headers:

Example output table.

Table in subplots (without row or column headers):

Example output in subplots.

Table with no row headers:

Example output table without 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

  • Simplify creating a table without any row-headers.
  • Consider makign the spacing for rows/cols dynamic, based on figsize might work.
  • 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.

About

Create custom table using matplotlib.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages