Skip to content

Support standard tickdir control (in/out/inout) in axisartist. #30369

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 29, 2025

... 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

@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
@anntzer
Copy link
Contributor Author

anntzer commented Jul 30, 2025

Sure, done.

Copy link
Member

@timhoffm timhoffm left a 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.

@anntzer
Copy link
Contributor Author

anntzer commented Jul 30, 2025

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

@timhoffm
Copy link
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]

... 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
Copy link
Contributor Author

anntzer commented Jul 31, 2025

Hopefully the missing references are fixed.

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: user guide files in galleries/users_explain or doc/users topic: mpl_toolkit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants