Skip to main content

Matrix legend layout for matplotlib

Project description

Matrix legend for Matplotlib

A small extension for Matplotlib's Legend to create matrix legends for plots parametrized with the cartesian product of two grids. Consider the following toy example of evaluating different functions with different "frequency" parameter values. Full enumeration of function+parameter pairs gets cumbersome very quickly, but the same information can be naturally presented in a table layout.

comparison of regular and matrix legends

Installation

pip install matplotlib-matrix-legend

Usage

The module exports one public function, a drop-in replacement for Axes.legend method. Since most of the functionality is inherited directly from the original Legend class, the styling, layout, custom handles and other features should largely work as expected.

from matrix_legend import matrix_legend

fig, ax = plt.subplots()
# your plotting here

# instead of ax.legend(...)
# see https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html
# for args & kwargs
matrix_legend(ax, ...)

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

matplotlib_matrix_legend-0.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matplotlib_matrix_legend-0.0.2-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file matplotlib_matrix_legend-0.0.2.tar.gz.

File metadata

File hashes

Hashes for matplotlib_matrix_legend-0.0.2.tar.gz
Algorithm Hash digest
SHA256 093715ad688fe77cf347fab6653375eb4e4bede5a4d3ff0094dbf4f23a2bf83d
MD5 b0934760a2f7829d86b03ad84bb1078f
BLAKE2b-256 3ff5d739b781ea859f34adf305fc945e4c9526bb993a77b654c83fec22a64df9

See more details on using hashes here.

File details

Details for the file matplotlib_matrix_legend-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for matplotlib_matrix_legend-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 372597ddb79bcb599ee3a56acaebeaee1d187cceb3966a0e17b264c720d5b5ef
MD5 6e403405c2c4f81e99d8b6d36e0079a1
BLAKE2b-256 d92c0f1031fa76c22b5e701dc1fdf0e2434799e91d2335dbca50f1f288b573c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page