Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Switch AxisArtist to use standard tick directions.#19102

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
anntzer wants to merge1 commit intomatplotlib:mainfromanntzer:aa-tickdir

Conversation

anntzer
Copy link
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:

ifself._ticklabel_add_angle!=self._axislabel_add_angle:if ((self.major_ticks.get_visible()# ???andnotself.major_ticks.get_tick_out())or (self.minor_ticks.get_visible()andnotself.major_ticks.get_tick_out())):axislabel_pad=self.major_ticks._ticksizeelse: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 theor should actually useminor_ticks twice instead ofminor_ticks and thenmajor_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 (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

i.e. defaulting to "out".  Also support "inout".Would perpendicular work better for "out"?  see e.g.demo_curvelinear_grid.
@leejjoon
Copy link
Contributor

leejjoon commentedNov 16, 2022
edited
Loading

  • There is one point in the old implementation which I do not understand:
ifself._ticklabel_add_angle!=self._axislabel_add_angle:if ((self.major_ticks.get_visible()# ???andnotself.major_ticks.get_tick_out())or (self.minor_ticks.get_visible()andnotself.major_ticks.get_tick_out())):axislabel_pad=self.major_ticks._ticksizeelse:axislabel_pad=0

My recollection is that this is to test if the axislabel and the ticklabels are on the same side. Ifself._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 theor should use minor_ticks twice.

image

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

@anntzer
Copy link
ContributorAuthor

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

@leejjoon
Copy link
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 introducetickangle_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?

@leejjoon
Copy link
Contributor

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

image
image

@anntzer
Copy link
ContributorAuthor

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

@anntzer
Copy link
ContributorAuthor

Superseded by#24553.

@anntzeranntzer closed thisJan 7, 2023
@anntzeranntzer deleted the aa-tickdir branchJanuary 7, 2023 13:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@anntzer@leejjoon

[8]ページ先頭

©2009-2025 Movatter.jp