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.1.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.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for matplotlib_matrix_legend-0.0.1.tar.gz
Algorithm Hash digest
SHA256 50cd3c2bc04bbdaa64b85bfb6df2bc76cd3c086c9ff9ae781a66ad623e94a553
MD5 1a5e8904e36b34c6060f95010ab98dc8
BLAKE2b-256 e13d5e2a7092f60a5f0e1e7ac93704e3dc1bda77773d11eaa172a82b360777b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for matplotlib_matrix_legend-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b89d4e2cd321172d3dfcd14d4d02dd837846cfccbd822485d2011a5aa63f3201
MD5 1338f65d023bc61b4371b0579a67cd52
BLAKE2b-256 aab817cc6aa72e116980265790bb32471f288d1def94c16165bdc914f0f17372

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