Skip to main content

faceted

tests codecov Documentation Status PyPI

Figures with precise control over overall width, overall height, plot aspect ratio, between-plot spacing, and colorbar dimensions.

Description

The purpose of this module is to make it easy to produce single-or-multi-panel figures in matplotlib with strict dimensional constraints. For example, perhaps you would like to make a figure that fits exactly within a column of a manuscript without any scaling, and you would like the panels to be as large as possible, but retain a fixed aspect ratio (height divided by width). Maybe some (or all) of your panels require an accompanying colorbar. With out of the box matplotlib tools this is actually somewhat tricky.

Internally, this module uses the flexible matplotlib AxesGrid toolkit, with some additional logic to enable making these kinds of dimensionally-constrained panel plots with precise padding and colorbar size(s).

Another project with a similar motivation is panel-plots; however it does not have support for adding colorbars to a dimensionally-constrained figure. One part of the implementation there that inspired part of what is done here is the ability to add user-settable padding to the edges of the figure (to add space for axes ticks, ticklabels, and labels). This eliminates the need for using bbox_inches='tight' when saving the figure, and enables you to make sure that your figures are exactly the dimensions you need for your use.

I intend to keep the scope of this project quite limited. I want the results it produces to remain extremely easy to understand and control. For more complicated figure layouts, e.g. multiple panels with different sizes and aspect ratios, and a more magical approach to setting figure boundary padding and between-panel spacing, a library worth checking out is proplot. The "smart tight layout" feature it provides is an impressive automated method of solving some of the same problems addressed by this library.

For information on how to use faceted, see the documentation: https://faceted.readthedocs.io/en/latest/.

Installation

You can install faceted either from PyPI:

$ pip install faceted

or directly from source:

$ git clone https://github.com/spencerkclark/faceted.git
$ cd faceted
$ pip install -e .

Metadata

Release files for faceted 2026.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faceted 2026.7.0
File Size Uploaded
faceted-2026.7.0.tar.gz 872.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for faceted 2026.7.0
File Interpreter ABI Platform
faceted-2026.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / faceted-2026.7.0.tar.gz

Download URL faceted-2026.7.0.tar.gz
Size 872.6 kB
Tags Source
SHA-256 checksum
How to use checksums
88e83a7a80f017129eb5a52f744c015a3f5101e90ca1168f7eb5ca65319357dc
BLAKE2b-256 checksum
How to use checksums
5009127f4635b018494fd3b981a479ce56a7023c518f6d78c8c0d78ed5d78e66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / faceted-2026.7.0-py3-none-any.whl

Download URL faceted-2026.7.0-py3-none-any.whl
Size 209.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1369b1ab3bf1d20dc8e7a85ede8bdb28971b2e9ef8f3c8e283f395f69a4076ed
BLAKE2b-256 checksum
How to use checksums
72400e330fd3e591c6a4cc2b1e44bb5af52e51e7f2e9ee4dbfe52244e4b9aa77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2026.7.0 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page