Skip to content

fix for #1235 #2857

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

Closed
wants to merge 3 commits into from
Closed

fix for #1235 #2857

wants to merge 3 commits into from

Conversation

wmak
Copy link

@wmak wmak commented Mar 3, 2014

Fix for #1235, legend box not taking points into account.

@tacaswell
Copy link
Member

@pelson Can you take a look at this? iirc you are the current legend expert. Do you think this can make in it for 1.4?

@tacaswell tacaswell added this to the v1.4.x milestone Mar 3, 2014
@pelson
Copy link
Member

pelson commented Mar 20, 2014

@wmak - would you be able to add a test.

iirc you are the current legend expert.

You write a bit of documentation and you get branded an expert for life 😄

@tacaswell - we've not cut a release candidate so there is no reason we can't put it in if we're happy. I'm just a little concerned about the use of _offsets on the axes collections and implicit assumption that they are all making use of transData (given my limited collection wisdom, I don't know if that is reasonable or not, but I'm tempted to try this out on something that doesn't use transform=transData to see how it works out. Perhaps something like:

import matplotlib.transforms as mtrans
offset = mtrans.Affine2D().translate(10, -10)

import matplotlib.pyplot as plt
plt.plot(range(30))
plt.scatter([20], [10], transform=offset + plt.gca().transData)

Which will put a point at [30, 0]. The question then is, is the legend computation taking this into account...

@tacaswell
Copy link
Member

I'm not worried so much about release candidate rules, but dev time to review.

Hopefully this weekend I will get an email sent out to the devel list with list of what needs to be done and a time line to cut a release candidate.

@wmak
Copy link
Author

wmak commented Mar 20, 2014

@pelson sorry I'm quite new to this, would you want comprehensive testing? Or would one or two test cases be sufficient?

@tacaswell
Copy link
Member

One or two tests would be fine. The test should fail with out this PR, but pass with it and should fail if we break this feature in the future.

@wmak
Copy link
Author

wmak commented Mar 27, 2014

I'm looking into creating the testcases, and I notice that there's an image comparison being performed for testing automatic legend creation (ie the ones in lib/matplotlib/tests/baseline_images/test_legend). Is there a standard way of creating these images?

@tacaswell
Copy link
Member

Run the tests locally (which will fail), but will save the output. Move the results to the expected image directory and add them to the repository. The next time you run the tests they should pass.

@efiring
Copy link
Member

efiring commented Jun 3, 2014

Trying to take collections into account is a nice idea, but I think that this implementation will work only under unduly restricted circumstances. It seems to be assuming that each item in the collection has negligible size, and that the _transOffset is transData. At the very least, wouldn't it make sense to do this only if if the assumption is true? Furthermore, if I am reading the changeset correctly, it looks like only the first offset of each collection is being checked. If true, that would greatly limit the effectiveness of the operation.

@tacaswell tacaswell modified the milestones: v1.5.x, v1.4.x Jan 13, 2015
@tacaswell tacaswell modified the milestones: proposed next point release, next point release Feb 19, 2015
@tacaswell tacaswell modified the milestones: proposed next point release, next point release Jun 18, 2015
@tacaswell
Copy link
Member

@wmak Are you still interested in working on this?

@dashed
Copy link
Contributor

dashed commented Feb 22, 2016

@pelson @efiring @tacaswell Seems this PR was put forth by a group of students as part of a university course in 2014. see: http://www.utsc.utoronto.ca/~atafliovich/cscd01/

@wmak may unlikely to follow up on this PR anymore as he has since graduated. I'm also taking the same course in question for the 2016 semester. I'm part of a team of students looking for bugs/features to take on; and we'll happily take over this PR.


I'm pretty much active on GitHub, so I can, and will definitely follow up on this PR till it's merged; even after I've finished the course 😄

@pelson
Copy link
Member

pelson commented Feb 22, 2016

@wmak may unlikely to follow up on this PR anymore as he has since graduated. I'm also taking the same course in question for the 2016 semester. I'm part of a team of students looking for bugs/features to take on; and we'll happily take over this PR.

Yes please. 👍 for your community spirit. Contributions very welcome!

@WeatherGod
Copy link
Member

This would actually be very important to have for the upcoming v2.0 release, as it will have "best" as default.

@QuLogic
Copy link
Member

QuLogic commented Mar 7, 2016

Replaced by #6110.

@QuLogic QuLogic modified the milestones: unassigned, 2.1 (next point release) Mar 7, 2016
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.

7 participants