ENH: Support wrap='axes' and wrap='figure' for axes-aware text wrapping#31716
ENH: Support wrap='axes' and wrap='figure' for axes-aware text wrapping#31716codegnan-dm wants to merge 1 commit into
Conversation
|
Please use the PR checklist provided in the PR template. It includes some items that are required and that you have missed here. |
|
⏰ This pull request might be automatically closed in two weeks from now. Thank you for your contribution to Matplotlib and for the effort you have put into this PR. This pull request does not yet meet the quality and clarity standards needed for an effective review. Project maintainers have limited time for code reviews, and our goal is to prioritize well-prepared contributions to keep Matplotlib maintainable. Matplotlib maintainers cannot provide one-to-one guidance on this PR. However, if you ask focused, well-researched questions, a community member may be willing to help. 💬 To increase the chance of a productive review:
As the author, you are responsible for driving this PR, which entails doing necessary background research as well as presenting its context and your thought process. If you are a new contributor, or do not know how to fulfill these requirements, we recommend that you familiarize yourself with Matplotlib's development conventions or engage with the community via our Discourse or one of our meetings before submitting code. If you substantially improve this PR within two weeks, leave a comment and a team member may remove the |
|
I added the “autoclose” because its comment provides useful links about what you need to do. Two weeks may not be long enough for this case so we can review as needed. |
|
@rcomer I have updated the PR description with the full checklist |
Closes #31655
Supersedes #31633
Summary
Extends the
wrapparameter ofText.set_wrap()to accept stringvalues in addition to bool:
wrap=Trueorwrap='figure': wrap to figure boundary (default,fully backward compatible)
wrap='axes': wrap to axes boundary when text is inside an axesThis design was discussed and agreed upon in issue #31655 by
@rcomer, @timhoffm, and @story645.
PR Checklist
Testing
Usage example:
AI Disclosure
This PR was developed with AI assistance for guidance on
implementation approach and code location. The coding, testing,
and verification were done manually.