Skip to content

Legend autopositioning with "spiraling" lines. #7625

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 30, 2017

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 14, 2016

Fix computation of the intersection between a line and a prospective
legend position by passing filled=False to line.intersects_bbox.

This fixes autopositioning of the legend e.g. with

plt.plot([0, 0, 1, 1, 0], [0, 1, 1, 0, 0], label="foo")
plt.legend()

where the legend should be placed "inside" the area enclosed by the
line.

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Dec 14, 2016
@tacaswell
Copy link
Member

Have no idea what is going wrong with the docs build, it is failing on finding a source file?

This seems reasonable, but needs a whats_new entry as a) it is cool! b) is under some views an API change so it should be documented (particularly now that 'auto' is the default legend location).

Fix computation of the intersection between a line and a prospective
legend position by passing ``filled=False`` to ``line.intersects_bbox``.

This fixes autopositioning of the legend e.g. with

    plt.plot([0, 0, 1, 1, 0], [0, 1, 1, 0, 0], label="foo")
    plt.legend()

where the legend should be placed "inside" the area enclosed by the
line.
@anntzer anntzer force-pushed the legend-autoposition-avoid-lines branch from 74e365a to e64f3fb Compare December 14, 2016 17:43
@anntzer
Copy link
Contributor Author

anntzer commented Dec 14, 2016

No idea what's happening about the build failure either.

Added a what's new entry although I'm not particularly happy with my wording, so suggestions are welcome.

@dstansby dstansby changed the title Legend autopositioning with "spiraling" lines. [MRG+1] Legend autopositioning with "spiraling" lines. Jan 29, 2017
Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

I think the what's new entry reads well, and I have restarted the doc build on travis.

@efiring efiring changed the title [MRG+1] Legend autopositioning with "spiraling" lines. Legend autopositioning with "spiraling" lines. Jan 30, 2017
@efiring efiring merged commit 5652c66 into matplotlib:master Jan 30, 2017
@efiring
Copy link
Member

efiring commented Jan 30, 2017

Nice improvement, thank you.

@anntzer anntzer deleted the legend-autoposition-avoid-lines branch January 30, 2017 07:22
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.

4 participants