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

Skip to content

Update ticklabel alignment examples. - #32317

Merged
timhoffm merged 1 commit into
matplotlib:mainfrom
anntzer:etla
Sep 8, 2026
Merged

Update ticklabel alignment examples.#32317
timhoffm merged 1 commit into
matplotlib:mainfrom
anntzer:etla

Conversation

@anntzer

@anntzer anntzer commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
  • Cross-reference the two (standard and mpl_toolkits) ticklabel alignment examples.
  • The standard example (align_ticklabels) is specifically about left-aligned yticklabels; update the title accordingly.
  • Present an alternative solution for left-aligned yticklabels, which should be more robust in practice (the padding needs to be guessed, whereas one can probably more often see what will be the widest string -- if needed, one can probably actually measure it using get_text_width_height_descent, though that would obscure the example here).
Figure_1 (the new figure: note how the second axes has tighter alignment)

PR summary

AI Disclosure

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • Plotting related features are demonstrated in an example
  • New features and API changes have release notes
  • Documentation complies with general and docstring guidelines

Comment thread galleries/examples/ticks/align_ticklabels.py Outdated
- Cross-reference the two (standard and mpl_toolkits) ticklabel
  alignment examples.
- The standard example (align_ticklabels) is specifically about
  left-aligned yticklabels; update the title accordingly.
- Present an alternative solution for left-aligned yticklabels,
  which should be more robust in practice (the padding needs to be
  guessed, whereas one can probably more often see what will be the
  widest string -- if needed, one can probably actually measure it
  using get_text_width_height_descent, though that would obscure the
  example here).
@timhoffm
timhoffm merged commit 4077a5e into matplotlib:main Sep 8, 2026
24 checks passed
@anntzer
anntzer deleted the etla branch September 8, 2026 14:54
@QuLogic QuLogic added this to the v3.12.0 milestone Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: examples files in galleries/examples Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants