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

Fix nonsensical transform in mixed-mode axes aspect computation.#14990

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

Merged
timhoffm merged 2 commits intomatplotlib:masterfromanntzer:mixedscaleaspect
Aug 7, 2019

Conversation

anntzer
Copy link
Contributor

@anntzeranntzer commentedAug 6, 2019
edited
Loading

PR Summary

The first commit fixes the nonsensical transform mentioned in#14899, while changing the test introduced in#14727 to match the behavior of autoscale which we decided in#14899 to keep at least for now (as refactoring it is going to require more work).

The second commit fixes the fact that I missed, in#14727, that I could just writetrf.transform(array) rather thanmap(trf.transform, array), i.e.Transform.transform works on arrays (and is documented to do so).

attn@efiring

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzeranntzer added the Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labelAug 6, 2019
@anntzeranntzer added this to thev3.2.0 milestoneAug 6, 2019
Copy link
Member

@efiringefiring left a comment

Choose a reason for hiding this comment

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

You might want to either remove the comment in the test, or modify the test so that it tests the zoomed-in case where the requested view limits are within larger data limits. This need not block the PR, though.

aspect=1, adjustable="datalim")
ax.margins(0)
ax.apply_aspect()
assert ax.get_xlim() == pytest.approx(np.array([1/10, 10]) * np.sqrt(10))
# Currently the autoscaler chooses to reduce the x-limits by half a decade
# on each end, but this may change later.
Copy link
Member

Choose a reason for hiding this comment

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

I don't know why it would, unless the test itself is changed. I think the point of confusion is that in this test you are plotting only one point, so apply_aspect is understandably and correctly shrinking an axis instead of expanding one. xlim and ylim pertain to view limits, not data limits. It looks like I made a big mistake, long ago, in calling the adjustable option "datalim", because it is not actually adjusting data limits--they remain determined by the actual plot calls and Artist additions--but rather, view limits. Maybe we should change the option name (with deprecation, in a separate PR) to "viewlim" or "viewlimits"?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I just removed the comment and let's punt the discussion of what the ideal behavior should be to, well, not this PR :)

@timhoffmtimhoffm merged commitd95e3f8 intomatplotlib:masterAug 7, 2019
@anntzeranntzer deleted the mixedscaleaspect branchAugust 7, 2019 19:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@efiringefiringefiring approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@efiring@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp