GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support standard tickdir control (in/out/inout) in axisartist. by anntzer · Pull Request #30369 · matplotlib/matplotlib

Conversation

@anntzer

@anntzer anntzer commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

... and also respect rcParams, which makes axisartist ticks default to pointing outwards, similarly to standard ticks.

Rework the tick direction machinery to also support "inout" (similarly to standard ticks).

One may wonder whether external ticks should really be drawn in the local direction of the gridlines, though, or whether drawing them orthogonal to the axis spine would look better. This PR keeps the old behavior of set_ticks_out(True), but we could later add something like set_tick_direction("out_ortho") (name up to bikeshedding).

While at it, also deprecate the entirely unused
Ticks.locs_angles_labels and LabelBase.locs_angles_labels.

See the modified simple_axis_pad example:
image
and demo_curvelinear grid shows why "out_ortho" may actually be a better option:
image

PR summary

PR checklist

  • "closes #0000" is in the body of the PR description to link the related issue
  • new and changed code is tested
  • Plotting related features are demonstrated in an example
  • New Features and API Changes are noted with a directive and release note
  • Documentation complies with general and docstring guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@anntzer anntzer added the topic: mpl_toolkit label Jul 29, 2025
@github-actions github-actions Bot added Documentation: examples files in galleries/examples Documentation: user guide files in galleries/users_explain or doc/users labels Jul 29, 2025
@anntzer
anntzer force-pushed the aiot branch 2 times, most recently from a80878e to 6831cb5 Compare July 29, 2025 23:16
timhoffm
timhoffm reviewed Jul 30, 2025
View reviewed changes
Comment thread lib/mpl_toolkits/axisartist/tests/test_axislines.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/tests/test_axislines.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/tests/test_axislines.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread galleries/users_explain/toolkits/axisartist.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@anntzer
anntzer force-pushed the aiot branch from 6831cb5 to 15bfe84 Compare July 30, 2025 10:54
@anntzer

anntzer commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

Sure, done.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

timhoffm
timhoffm reviewed Jul 30, 2025
View reviewed changes

@timhoffm timhoffm left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sorry, I'm a bit nit-picky today, but let's improve on code and docs, when we touch it anyway.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread galleries/users_explain/toolkits/axisartist.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread galleries/users_explain/toolkits/axisartist.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread galleries/users_explain/toolkits/axisartist.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread galleries/users_explain/toolkits/axisartist.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/axis_artist.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/axis_artist.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/tests/test_floating_axes.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/tests/test_grid_helper_curvelinear.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/tests/test_grid_helper_curvelinear.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/tests/test_floating_axes.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@anntzer
anntzer force-pushed the aiot branch from 15bfe84 to c22b36b Compare July 30, 2025 23:54
@anntzer

anntzer commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

No worries, it's good to improve this...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

timhoffm
timhoffm approved these changes Jul 31, 2025
View reviewed changes
@timhoffm

timhoffm commented Jul 31, 2025

Copy link
Copy Markdown
Member

Some refs still need fixing:

/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:425: WARNING: py:obj reference target not found: Tick.set_tick_direction [ref.obj]3d.Axes3D.get_zinverted
/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:426: WARNING: py:obj reference target not found: Tick.set_ticksize [ref.obj]
/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:431: WARNING: py:obj reference target not found: TickLabels.set_rotation [ref.obj]
/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:432: WARNING: py:obj reference target not found: TickLabels.set_ha [ref.obj]
/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:432: WARNING: py:obj reference target not found: TickLabels.set_va [ref.obj]
/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:437: WARNING: py:obj reference target not found: AxisLabel.set_rotation [ref.obj]
/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:438: WARNING: py:obj reference target not found: AxisLabel.set_ha [ref.obj]
/home/circleci/project/doc/users/explain/toolkits/axisartist.rst:438: WARNING: py:obj reference target not found: AxisLabel.set_va [ref.obj]
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

timhoffm
timhoffm reviewed Jul 31, 2025
View reviewed changes
Comment thread lib/mpl_toolkits/axisartist/axis_artist.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

timhoffm
timhoffm reviewed Jul 31, 2025
View reviewed changes
Comment thread galleries/users_explain/toolkits/axisartist.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@anntzer
anntzer force-pushed the aiot branch from c22b36b to 5a134ed Compare July 31, 2025 05:53
@anntzer

anntzer commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

Hopefully the missing references are fixed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

QuLogic
QuLogic reviewed Mar 10, 2026
View reviewed changes
Comment thread lib/mpl_toolkits/axisartist/tests/test_axislines.py
# Remove this line when this test image is regenerated.
plt.rcParams['text.kerning_factor'] = 6
plt.rcParams.update({
"text.kerning_factor": 6, "xtick.direction": "in", "ytick.direction": "in"})

@QuLogic QuLogic Mar 10, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Do you intend that all of these be removed in the text-overhaul branch, as text.kerning_factor will be?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@anntzer anntzer Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I pushed a second commit (as usual, without the actual baseline image updates) where I take advantage of the upcoming text-overhaul branch to update the tests as well; now they are a mix of "in", "out", and "inout" (to test a bit everything). Note that there are also other axisartist tests where there is a high tolerance currently set due to partial updates to the axisartist code; likely those could also have their tolerance set to zero again as the baselines will likely need to be regen'd anyways (I didn't touch them, but I can do it if you prefer -- it's just a grep for tol in the test suite of axisartist).

Let me know if you want me to retarget this to text-overhaul.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@QuLogic QuLogic Mar 10, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'd rather this get in through regular review, but maybe you can target the second commit to the text-overhaul branch? Not sure if that's too much work though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@anntzer anntzer Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No problem at all, but the second commit only makes sense after the first (feature) goes in to main and main gets merged back into text-overview (so this PR is effectively blocking the final merge-back)? Unless we decide not to take advantage of the opportunity to update the baselines here to test the new functionality.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@QuLogic QuLogic Mar 10, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well, we already have one approval and I don't think much has changed since then, so I'm sure we can merge this one right now. I can merge main into text-overhaul after that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@anntzer anntzer Mar 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

OK, so I dropped the testing commit from this PR; that commit exists now at anntzer@f1777c6 (aiot-tests branch). Right now that commit is atop the main branch (via this PR), I will rebase it atop text-overhaul once this PR is merged into main and main into text-overhaul, and open a PR for it.
(Note that the aiot-tests commit stills builds upon this PR because this one already alters the tests but in a way that fully maintains backcompatibility of baseline images so that tests locally pass; thus the aiot-tests commit also needs to undo these alterations.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@anntzer anntzer Mar 11, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The test suite update is now at #31281.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@anntzer
anntzer force-pushed the aiot branch from 5a134ed to 4f29735 Compare March 10, 2026 09:54
QuLogic
QuLogic reviewed Mar 10, 2026
View reviewed changes
Comment thread lib/mpl_toolkits/axisartist/axis_artist.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/mpl_toolkits/axisartist/axis_artist.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@anntzer
Support standard tickdir control (in/out/inout) in axisartist.
61b6cdc
... and also respect rcParams, which makes axisartist ticks default to
pointing outwards, similarly to standard ticks.

Rework the tick direction machinery to also support "inout" (similarly
to standard ticks).

One may wonder whether external ticks should really be drawn in the
local direction of the gridlines, though, or whether drawing them
orthogonal to the axis spine would look better.  This PR keeps the old
behavior of `set_ticks_out(True)`, but we could later add something like
``set_tick_direction("out_ortho")`` (name up to bikeshedding).

While at it, also deprecate the entirely unused
`Ticks.locs_angles_labels` and `LabelBase.locs_angles_labels`.
@anntzer
anntzer force-pushed the aiot branch 2 times, most recently from f1777c6 to 61b6cdc Compare March 11, 2026 09:06
@QuLogic QuLogic added this to the v3.11.0 milestone Mar 11, 2026
QuLogic
QuLogic approved these changes Mar 11, 2026
View reviewed changes
@QuLogic
QuLogic merged commit 94d09cd into matplotlib:main Mar 11, 2026
40 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Mar 11, 2026
support for ticks crossing axes in axisartist #19101
Closed
AxisArtist to use standard tick directions and have an option for tick orientation #24553
Open
Switch AxisArtist to use standard tick directions. #19102
Closed
@anntzer
anntzer deleted the aiot branch March 11, 2026 18:07
@anntzer anntzer mentioned this pull request Mar 11, 2026
Drop axis_artist tickdir image compat, due to text-overhaul merge. #31281
Merged
5 tasks
andreas16700 added a commit to andreas16700/matplotlib that referenced this pull request Mar 16, 2026
@andreas16700
Run 94d09cd: Merge pull request matplotlib#30369 from anntzer/aiot
e977b9c
andreas16700 added a commit to andreas16700/matplotlib that referenced this pull request Mar 16, 2026
@andreas16700
Run 94d09cd: Merge pull request matplotlib#30369 from anntzer/aiot
de07e49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@timhoffm timhoffm timhoffm approved these changes
@QuLogic QuLogic QuLogic approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Documentation: examples files in galleries/examples Documentation: user guide files in galleries/users_explain or doc/users topic: mpl_toolkit

Projects

None yet

Milestone

v3.11.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@anntzer @timhoffm @QuLogic
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.