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 — Switch AxisArtist to use standard tick directions. by anntzer · Pull Request #19102 · matplotlib/matplotlib

Conversation

@anntzer

@anntzer anntzer commented Dec 11, 2020

Copy link
Copy Markdown
Contributor

i.e. defaulting to "out". Also support "inout".


I had this patch lying around, and am only posting it because of #19101 (which this implements). Although tests pass, there are a few remaining points:

  • The default change (to "out"), as well as the new feature, have to be documented.

  • There is one point in the old implementation which I do not understand:

        if self._ticklabel_add_angle != self._axislabel_add_angle:
            if ((self.major_ticks.get_visible()  # ???
                 and not self.major_ticks.get_tick_out())
                or (self.minor_ticks.get_visible()
                    and not self.major_ticks.get_tick_out())):
                axislabel_pad = self.major_ticks._ticksize
            else:
                axislabel_pad = 0

I don't understand the conditions in which the pad are zero or nonzero, and don't know either whether the second branch of the or should actually use minor_ticks twice instead of minor_ticks and then major_ticks. Thus I don't know either how the check should be adapted for the "inout" case.

  • I feel like "out" ticks actually look quite ugly when they are kept tangential to the gridline, as can be seen e.g. with demo_curvelinear_grid, which now gives
    test
    I feel like it would actually look much nicer to have ticks perpendicular to the spines?

attn @jasondet I guess, feel free to pick up the patch.

PR Summary

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

Sorry, something went wrong.

Uh oh!

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

All reactions
@anntzer
Switch AxisArtist to use standard tickdirs.
810cd5b
i.e. defaulting to "out".  Also support "inout".

Would perpendicular work better for "out"?  see e.g.
demo_curvelinear_grid.
@anntzer anntzer added the topic: mpl_toolkit label Dec 11, 2020
@anntzer anntzer mentioned this pull request Dec 11, 2020
support for ticks crossing axes in axisartist #19101
Closed
@github-actions github-actions Bot added the status: needs rebase label Oct 18, 2022
@leejjoon

leejjoon commented Nov 16, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • There is one point in the old implementation which I do not understand:
        if self._ticklabel_add_angle != self._axislabel_add_angle:
            if ((self.major_ticks.get_visible()  # ???
                 and not self.major_ticks.get_tick_out())
                or (self.minor_ticks.get_visible()
                    and not self.major_ticks.get_tick_out())):
                axislabel_pad = self.major_ticks._ticksize
            else:
                axislabel_pad = 0

My recollection is that this is to test if the axislabel and the ticklabels are on the same side. If self._ticklabel_add_angle != self._axislabel_add_angle is True, it means that they on different side. In this case, we only need to check if the ticks are on the same side as the axislabel. Also, the second branch of the or should use minor_ticks twice.

image

All reactions

Sorry, something went wrong.

Uh oh!

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

@leejjoon

leejjoon commented Nov 16, 2022

Copy link
Copy Markdown
Contributor

I just realized that this is a two-year old PR. It would be still good if this can be merged after some more fix. I can work on it if that is desired.

All reactions

Sorry, something went wrong.

Uh oh!

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

@anntzer

anntzer commented Nov 16, 2022

Copy link
Copy Markdown
Contributor Author

@leejjoon Feel free to pick it up; it was essentially a proof of concept in reply to #19101.
One thing I would suggest to change, though, is the orientation of ticks with the "out" direction: as noted above, I think it would look nicer if they were actually perpendicular to the box, rather than tangential with the gridline. (Inwards ticks can stay tangential.)

All reactions

Sorry, something went wrong.

Uh oh!

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

@leejjoon

leejjoon commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

One thing I would suggest to change, though, is the orientation of ticks with the "out" direction: as noted above, I think it would look nicer if they were actually perpendicular to the box, rather than tangential with the gridline. (Inwards ticks can stay tangential.)

For this, I'd like to introduce tickangle_mode. For now, it's argument could be 'auto' (or None), 'normal', and 'parallel'. 'normal' is for perpendicular to the box, 'parallel' is for parallel to gridlines, and 'auto' is 'normal' only if tickdir is 'out'.

However, I don't think these are good choice of option names. Any recommendation?

All reactions

Sorry, something went wrong.

Uh oh!

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

@leejjoon

leejjoon commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

Here are some exanples. For the floating_axis, I enforced "parallel" mode.

image
image

All reactions

Sorry, something went wrong.

Uh oh!

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

@anntzer

anntzer commented Nov 21, 2022

Copy link
Copy Markdown
Contributor Author

I would perhaps call this tick_orientation={"parallel", "normal", "auto"}. Perhaps @timhoffm can chime in?

All reactions

Sorry, something went wrong.

Uh oh!

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

@leejjoon leejjoon mentioned this pull request Nov 27, 2022
AxisArtist to use standard tick directions and have an option for tick orientation #24553
Open
6 tasks
@anntzer

anntzer commented Jan 7, 2023

Copy link
Copy Markdown
Contributor Author

Superseded by #24553.

All reactions

Sorry, something went wrong.

Uh oh!

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

@anntzer anntzer closed this Jan 7, 2023
@anntzer
anntzer deleted the aa-tickdir branch January 7, 2023 13:39
@QuLogic

QuLogic commented Mar 11, 2026

Copy link
Copy Markdown
Member

Actually superseded by #30369 in the end.

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

status: needs rebase topic: mpl_toolkit

Projects

None yet

Milestone

No milestone

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