Skip to content

Add function for "concatenating" figures #203

Open

Description

@lukelbd

Problem

It is quite common to want separate figure-files for individual subplots along with a single larger figure containing the exact same subplots in a grid. In matplotlib, there is currently no good way to do this. This stackoverflow answer suggests defining separate functions that accept an axes and do all the plotting, but a more intuitive way would be nice:

Solution

At some point I would like to add a pplt.concatenate_figs function used for "concatenating" smaller figures (usually, but not necessarily, containing just one subplot) into larger figures with multiple subplots. Users should be able to pass lists of axes and have proplot concatenate them along rows or columns with e.g. pplt.concatenate_figs(..., rows=True|False), or pass lists of lists of subplots in which case they are concatenated according to this 2D layout.

This shouldn't be very difficult to code, but I might need to wait for #110 to finish.

Activity

  1. added this to the Version 1 milestone on Jul 21, 2021
  2. lukelbd commented on Aug 22, 2021

    @lukelbd
    CollaboratorAuthor

    Matplotlib now has this possibly-related "subfigures" feature but I think the goals of that feature are different from what I'm proposing here.

    It doesn't look like "subfigures" can be saved independently -- it looks like their idea is mostly to have independent gridspec layouts and axes styles, both of which are possible in proplot using format with e.g. ax.format(style=local_style) or by using gridspecs with different row/column spacings e.g. pplt.GridSpec(wspace=[1, 2]). So the feature proposed here is definitely still worth doing.

  3. ponnhide commented on Jan 29, 2022

    @ponnhide

    (If it's not an appropriate post, please feel free to delete it.)
    Thank you for developing the awesome library. In particular, I'm impressed with the local formatting function for each subplot.
    By the way, I have recently developed a new subplot manager, "patchworklib", that allows users to quickly arrange multiple matplotlib plots with only "|" and "/" operators. Then, I thought the patchworklib implementation may help realize the function suggested in the issue.
    If you are interested in patchworklib, I'm thinking of optimizing patchworklib for the proplot system. If you have any advice or ideas, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions