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.3.tar.gz (6.9 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.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for matplotlib_matrix_legend-0.0.3.tar.gz
Algorithm Hash digest
SHA256 beca63b311a039b2509736f97576e52443370f1ff9cc523953bdd927520ff274
MD5 f97f900ed6c6427986ca7f58911fe755
BLAKE2b-256 f51339449d183a78a0bf35ccdd1427ebefe6a8a729d87fb9177befbe4972938e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for matplotlib_matrix_legend-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0e532c8a8d7adbf60a37c3399313ace4bba1a11db56372f789fe9a61baec3dce
MD5 a2760c027a801ea307134bf641e4bbd4
BLAKE2b-256 62652f61e699d5b53820696001293871fe871f6afaf5c1696d03476410bc3002

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