-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: improve annotation demo #6455
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
ax.annotate('pixel offset from axes fraction', xy=(1, 0), | ||
xycoords='axes fraction', | ||
xytext=(-20, 20), | ||
textcoords='offset pixels', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the documentation, including the block at the top of the example, lists "offset pixels" as a valid option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here and removed the comments about negative directions.
On my to-do list for today is a more general going over of the annotation docs as I think we cleaned up the arrow handling we may have broken API a bit (using xytext without arrowprops does not draw an arrow any more).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, did we remove all negative direction handling?
xycoords='axes points', | ||
horizontalalignment='right', verticalalignment='bottom', | ||
fontsize=20) | ||
ax.annotate('pixel offset from axes fraction', xy=(1, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we removed the special casing of negative numbers on the axes *
coordinate systems (see #4843)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(continued) that example will put text that is right algined starting at 20px to the left of left edge of the axes. The example in the PR puts the text 20px to the left of the right edge of the axes.
Instead of line comments (which I broke the email links to by force-pushing an updated commit), consolidate the negative related comments here. In discussion in #4292 (implemented in #4843) we decided to remove all of the negative wrapping from annotations. That change was the source of the very broken looking example. On a bit more consideration, this example should probably be an image test. |
closes #5994
is what it looks like now.
We will probably have to revisit this on 2.x due to the default figure size/dpi changes.