8000 Fix spy(..., marker=<not-None>, origin="lower") by anntzer · Pull Request #16265 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix spy(..., marker=<not-None>, origin="lower") #16265

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

Merged
merged 1 commit into from
Jan 26, 2020

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Jan 19, 2020

and validate the origin kwarg both for spy() and for imshow().

There are some other slightly questionable choices in spy() (e.g. always
calling xaxis.set_ticks_position("both") but not doing the same for
the yaxis), but let's leave this as is for now.

Closes #16252.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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

8000
and validate the origin kwarg both for spy() and for imshow().

There are some other slightly questionable choices in spy() (e.g. always
calling `xaxis.set_ticks_position("both")` but not doing the same for
the yaxis), but let's leave this as is for now.
@anntzer anntzer added this to the v3.3.0 milestone Jan 19, 2020
@@ -7560,6 +7555,11 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
non-square pixels.
- *None*: Use :rc:`image.aspect`.

origin : {'upper', 'lower'}, default: :rc:`image.origin`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this just makes the doc order match the signature order.

self.title.set_y(1.05)
self.xaxis.tick_top()
if origin == "upper":
Copy link
Member

Choose a reason for hiding this comment

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

This seems like an additional change in behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that was explicitly mentioned in the report ("Though it's worth pointing out that the x-axis ticks and labels always end up in upper spine, not the lower one, regardless of origin='upper' or origin='lower'. The behavior of imshow is a bit different. If origin='lower', the ticks and labels are moved to the bottom.") and clearly looks like an error as well.

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member
@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

Modulo comment about the change in behavior of where the x tick labels go.

Copy link
Member
@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

with no reservations.

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

Successfully merging this pull request may close these issues.

axes.spy plotting function doesn't respect origin='lower' kwarg when marker is not None
3 participants
0