8000 Simplify gridspec.py. by anntzer · Pull Request #10119 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Simplify gridspec.py. #10119

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

Merged
merged 1 commit into from
Jan 9, 2018
Merged

Simplify gridspec.py. #10119

merged 1 commit into from
Jan 9, 2018

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Dec 27, 2017

PR Summary

All's in the title.

Note that this technically changes the behavior on nonsensical gridspecs, now erroring them instead of passing them through:

from matplotlib import pyplot as plt
from matplotlib.gridspec import GridSpec

gs = GridSpec(3, 3)

# Would previously make an axes spanning the whole figure.
plt.gcf().add_subplot(gs[-20:-19])

# Would previously make an axes spanning the whole first column.
plt.gcf().add_subplot(gs[-20:-19, 0])

plt.show()

Not sure if that warrants an API change note...

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

@anntzer anntzer force-pushed the gridspec-cleanup branch 2 times, most recently from 1e29def to 9f3957c Compare December 27, 2017 19:21
Copy link
Member
@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look nice to me. unravel_index is a new one for me - looks very useful!

@jklymak
Copy link
Member
jklymak commented Dec 29, 2017

Umm, though apparently needs a rebase...

@anntzer
Copy link
Contributor Author
anntzer commented Dec 29, 2017

done

@jklymak jklymak added this to the v2.2 milestone Jan 2, 2018
@efiring efiring merged commit 8249f8a into matplotlib:master Jan 9, 2018
@anntzer anntzer deleted the gridspec-cleanup branch January 9, 2018 01:18
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0