Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
May 21, 2016
Merged

Conversation

tacaswell
Copy link
Member

closes #5994

image

is what it looks like now.

We will probably have to revisit this on 2.x due to the default figure size/dpi changes.

ax.annotate('pixel offset from axes fraction', xy=(1, 0),
xycoords='axes fraction',
xytext=(-20, 20),
textcoords='offset pixels',
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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),
Copy link
Member Author

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)

Copy link
Member Author

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.

@tacaswell tacaswell added this to the 1.5.2 (Critical bug fix release) milestone May 21, 2016
@tacaswell
Copy link
Member Author

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.

@efiring efiring merged commit 43346e1 into matplotlib:v1.5.x May 21, 2016
@tacaswell tacaswell deleted the doc_annotation branch May 21, 2016 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants