Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add function for "concatenating" figures #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lukelbd opened this issue Jul 7, 2020 · 2 comments
Open

Add function for "concatenating" figures #203

lukelbd opened this issue Jul 7, 2020 · 2 comments
Labels
Milestone

Comments

@lukelbd
Copy link
Collaborator

lukelbd commented Jul 7, 2020

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.

@lukelbd lukelbd added the feature label Jul 7, 2020
@lukelbd lukelbd added this to the Version 1 milestone Jul 21, 2021
@lukelbd
Copy link
Collaborator Author

lukelbd commented Aug 22, 2021

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.

@ponnhide
Copy link

(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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants