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

Skip to content

Text contains (was #687) #924

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 4 commits into from
Jun 6, 2012
Merged

Conversation

pelson
Copy link
Member

@pelson pelson commented Jun 6, 2012

Fixes the contains bug raised in #687 & adds a test.

This issue does not arise on v1.1.x.


contains, _ = txt.contains(mevent)

color = {False: 'red', True: 'yellow'}.get(contains)
Copy link
Member

Choose a reason for hiding this comment

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

Very minor point, but I find this approach slightly easier to read:

'yellow' if contains else 'red'

@mdboom
Copy link
Member

mdboom commented Jun 6, 2012

Other than that one nit, looks good to me.

Someday, the contains should probably be made rotation-aware, but this is good enough for now to just restore the old behavior.

mdboom added a commit that referenced this pull request Jun 6, 2012
@mdboom mdboom merged commit e7d00d2 into matplotlib:master Jun 6, 2012
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