Skip to main content

NestedGridPlotter is based on matplotlib and intends to simplify the plotting of nestedgrid by providing a objected oriented class.

Project description

License Stars Python PyPI Downoads Build Status Documentation Status Coverage codacy Precommit: enabled Black Ruff Checked with ty DOI

🚀 Quick start

To install nested-grid-plotter functionality, see the installation instructions.

For a deep overview of nested-grid-plotter functionality, see the user guide.

You can also refer to the API reference guide for an exhaustive list of all what is possible with nested-grid-plotter.

🎯 Motivations

NestedGridPlotter is based on matplotlib and intends to simplify the plotting of nestedgrid by providing a objected oriented class.

import nested_grid_plotter as ngp

plotter = ngp.NestedGridPlotter(
    ngp.Figure(
        constrained_layout=True,  # Always use this to prevent overlappings
        figsize=(10, 5),
    ),
    builder=ngp.SubfigsBuilder(
        nrows=1,
        ncols=2,
        sub_builders={
            "the_left_sub_figure": ngp.SubplotsMosaicBuilder(
                mosaic=[["lt1", "lt1"], ["lb1", "rb1"]],
                gridspec_kw=dict(height_ratios=[2, 1], width_ratios=[2, 1]),
                sharey=False,
            ),
            "the_right_sub_figure": ngp.SubplotsMosaicBuilder(
                mosaic=[["l2", "rt2"], ["l2", "bt2"]],
                gridspec_kw=dict(height_ratios=[2, 1], width_ratios=[2, 1]),
                sharey=False,
            ),
        },
    ),
)
plotter.identify_axes()  # Helper to add the name of the axis on the plot
plotter.fig
nested_grid

Example of figure with nested figures and axes built using nested_grid_plotter.

It provide multiple utilities such as grid alignment:

alignment

Example of grid ticks alignment made easy thanks to nested_grid_plotter.

As well as wrapper for complex plots and animations.

animation_example

Example of complex animation built using nested_grid_plotter.

It also allows to make legend positioning and gathering flexible and simpler with some automatic placement solvers:

complex_legend

Example of figure with semi-automatic legend placement to avoid overlappings with axis labels and plots.

The complete and up to date documentation can be found here: https://nested_grid_plotter.readthedocs.io.

In addition to simplifying the matplotlib workflow, our focus are:

  • To provide understandable, modern code using the high-level language python, while using typing, explicit function names and standardized formatting thanks to Ruff and ty;

  • To provide detailed and explicit documentation;

  • To offer totally free code, including for commercial use, thanks to the BSD 3-Clause License;

🖋️ How to cite

If you use this piece of software in your work, please cite it as:

Collet, A. (2026). NestedGridPlotter - A matplotlib wrapper for nested grids and some more.
Zenodo. DOI: `10.5281/zenodo.18121868` https://doi.org/10.5281/zenodo.18121868

📧 Contact

For questions, suggestions, or contributions, you can reach out via:

We welcome contributions!

🔑 License

This project is released under the BSD 3-Clause License.

Copyright (c) 2026, Antoine COLLET. All rights reserved.

For more details, see the LICENSE file included in this repository.

⚠️ Disclaimer

This software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, or non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.

By using this software, you agree to accept full responsibility for any consequences, and you waive any claims against the authors or contributors.

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

nested_grid_plotter-2.0.0.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

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

nested_grid_plotter-2.0.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file nested_grid_plotter-2.0.0.tar.gz.

File metadata

  • Download URL: nested_grid_plotter-2.0.0.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for nested_grid_plotter-2.0.0.tar.gz
Algorithm Hash digest
SHA256 68cc4aad6e1d9b1d08aa2d106b077f5ae75009e27011e543c349d31bcbb09dd3
MD5 9d8b7b9161d36900bfd3b06413803371
BLAKE2b-256 65d134d43ca905191585d1b46fe743f16a1f6a87a8b310f65f5585fc30688184

See more details on using hashes here.

File details

Details for the file nested_grid_plotter-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nested_grid_plotter-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d320704ed16b2b76bb32d5dd772203b4c436a8fa73e64a8fffa224da246d131
MD5 829a6bb350b653c051018d230b043183
BLAKE2b-256 96578e962b16a6f112a4be4a120ac3ce30c2c7012b771f618141e2fcdfc2dbe0

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