Skip to content

Doc: spines arrows example #17180

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

Conversation

ImportanceOfBeingErnest
Copy link
Member

PR Summary

Replacement for #17170. (see discussion there)
Closes #17157

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

@QuLogic QuLogic requested a review from anntzer April 17, 2020 21:48
This example shows some configurations for axis style.

Note: If you want to obtain arrow heads at the ends of the axes, also check
out the :doc:`/gallery/recipes/centered_spines_with_arrows` example.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest warning more explicitly against using axisartist unless you know you really need it, given its limitations.

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.

I'm happy with this as-is and leave to @ImportanceOfBeingErnest to decide if we should add more notes of caution or not.

anyone can merge on CI green.

@ImportanceOfBeingErnest ImportanceOfBeingErnest force-pushed the doc-spinesarrows branch 2 times, most recently from 64d5297 to f0b7d52 Compare April 18, 2020 10:35
Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

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

can selfmerge postci

@ImportanceOfBeingErnest ImportanceOfBeingErnest merged commit f369b10 into matplotlib:master Apr 18, 2020
@ImportanceOfBeingErnest ImportanceOfBeingErnest deleted the doc-spinesarrows branch April 18, 2020 12:15
# right/top of the axes). Also, disable clipping (clip_on=False) as the marker
# actually spills out of the axes.
ax.plot(1, 0, ">k", transform=ax.get_yaxis_transform(), clip_on=False)
ax.plot(0, 1, "^k", transform=ax.get_xaxis_transform(), clip_on=False)

Choose a reason for hiding this comment

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

Does something like this add arrows on the other ends of the axes, as well? (For when axes are lines instead of only rays)

ax.plot(0, 0, "<k", transform=ax.get_yaxis_transform(), clip_on=False)
ax.plot(0, 0, "vk", transform=ax.get_xaxis_transform(), clip_on=False)

Choose a reason for hiding this comment

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

... Aesthetically, arrows on both ends of each axis are probably what most math teachers are looking for

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.

"Classical" zero-axis plot with arrows and symmetric ticks seems to be impossible
5 participants