axes collage by tacaswell · Pull Request #16603 · matplotlib/matplotlib · GitHub
Skip to content

axes collage - #16603

Merged
efiring merged 1 commit into
matplotlib:masterfrom
tacaswell:enh_subplot_grid
Jun 13, 2020
Merged

efiring merged 1 commit into
matplotlib:masterfrom
tacaswell:enh_subplot_grid

Conversation

@tacaswell

@tacaswell tacaswell commented Feb 28, 2020

Copy link
Copy Markdown
Member

PR Summary

This is an attempt at implementing a nicer API for laying out complex axes schemes like patchwork for ggplot. This is following on from a conversation @anntzer and @story645 had a few weeks ago
https://hackmd.io/4zWKhuLXQ16Y_oUfi9hnKA#Gridspec-Easy-API and was done on a red-eye flight home

The big win here is things like

x = [["A", "A", "B"], ["C", "D", "B"]]
fig = plt.figure()
axes = fig.build_grid(x)
axes['A'].plot(...)

do what you expect.

open questions:

  • Name (Hannah suggested something riffing to "collage" which I think is good if we can make it a verb)
  • does this go in Matplotib or does this go in a small library under the mpl org?
  • better tests of things going wrong
  • be sure that when re-assigning grid specs we clean up all the evidence of the old one (to be sure constrained layout works etc)
  • do we want the expansion logic to work ([['A'], ['B', 'C']] <-> [['A', 'A'][ ['B', 'C']])
  • keys in return dict when adjusting existing axes
  • provide a way to have mixed subplot_kw to each of the created figures to do later

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

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

Labels

New feature Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.