-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Annotation with negative axes fraction coordinate placed incorrectly with v1.4.3 #4292
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
Comments
See #4019 This is un-breaking something that was broken in 1.4.0. |
The 4.3 behavior seems very odd, though. Why would anyone want this behavior? It seems inconsistent with every other case of positioning--does any other object positioning function do a wraparound like this? It imposes unnecessary restrictions on where one can position annotations. |
For reference, the original issue which triggered this 'fix' was #4012 Sorry, I was not careful about this twice. |
I am also not sure what the best course of action here is. I am in favor of rolling back to the 1.3.1 behavior for back-compatibility issues, but the asymmetry is annoying. |
@tacaswell, I think this just points to the complexity of the code, and some uncertainty as to how it really should behave. |
I think I am ok with that. Do we want to just revert #4019 for now and add the extra kwargs is later or try to do both now? This does put us on track to have kwargs which are only sometimes used which is part of the problem with all of the FancyArrow/Box code. How about putting the logic in the The other option I see is |
I am obviously not a lead matplotlib developer, but I thought I would put in my two cents as a user. I don't see why you would want wrapping in 99 % of the cases. IMHO, if a user wants wrapping behavior, they can easily implement it in their own code. |
The compelling case is mostly for points based units. Saying "I want the On Sun, Mar 29, 2015 at 10:37 PM Benjamin Reedlunn [email protected]
|
Hmm, I see. Can't you get the axes size in normalized figure coordinates, and then use the figure size to figure out the physical size of the axes? Perhaps you need a Here is another thought. The |
Exactly--what is needed is not wrapping, but an origin. I think it would be enough to be able to specify origins as "SW", "SE", "NE", and "NW". Positions would be signed offsets from those origins. No wrapping at all. No inversions. |
@efiring I like that a lot better than either of my ideas. |
What about specifying the origin in normalized axes coordinates? That would combine the flexibility of the |
@tacaswell You just sent out an email to the dev list asking if there are any issues that we would like to see tagged as "next release critical". In my mind this is one of them. The ability to specify an origin would be great, but if it turns out to be difficult to implement, would it be possible to just roll back the 1.4.2 annotation behavior? |
Rolling back to the 1.4.2 behaviour is my current base-line for this and I Can you create a new issue for adding the origin. I am not sure you can't On Tue, Jun 16, 2015 at 9:22 AM Benjamin Reedlunn [email protected]
|
Ok, so here is my understanding of what happened here. For 1.4.0 I refactored annotations (#2351 ) but I missed that This was noticed in #4012 and fixed in #4019 but that catches too many of the coordinate systems (should not be all things that start with I see two reasonable courses of action:
I am inclined to go with option 1 and just accept the API break (and hope no one takes my commit rights away). |
Agreed: best course of action for now is to eliminate wrapping. That's good enough for this release. It makes the behavior simpler and more predictable. Then, with no time pressure, whoever is suitably inspired can put in a PR to add an origin kwarg. The full Annotation and even Text API's are so complicated that I think we can be allowed a little breakage in the process of trying to fix bugs and get the code and APIs under control. I took that point of view in #4178; for example, when eliminating the YAArrow code path I did not try to support every quirk and surprise of its behavior and API. |
Option 1 works for me. |
+1 option 1 |
It has dawned on me that there is a very easy way to implement an 'origin' as annotation already takes two positions (xy, xyann). I think we can just allow the word 'offset' to be prefixed to any of the |
…rds" This reverts commit d6e1577, reversing changes made to b280f7d. For 1.4.0 tacaswell refactored annotations (matplotlib#2351 ) but missed that {'axes points', 'axes pixel', 'figure points', 'figure pixel'} were special cased to wrap. Presumably from the function name to maintain back compatibility. This was an unintentional and undocumented API break. This API break was noticed in matplotlib#4012 and fixed in matplotlib#4019 but that catches too many of the coordinate systems (should not be all things that start with 'axes') so fixed one API, but broke others. There were two reasonable courses of action: 1. revert back to 1.4.2 behavior with nothing wrapping. 2. revert back to 1.3.1 behavior with somethings wrapping. In the discussion in matplotlib#4292 where the consensus was to go with option 1, hence this reversion.
It might be a good idea--but the annotation API and code are already
so complicated and idiosyncratic that I think it would be a mistake to
make them even more complicated right now. Actually, I probably don't
understand exactly what you are suggesting here.
|
I am finding that annotations placed outside of axes get placed incorrectly in v1.4.3. Here is an example:
In matplotlib v1.4.2 the plot looks like this:

In matplotlib v1.4.3 the plot looks like this:

Apparently v1.4.3 takes a negative axes fraction (or points) and wraps it around to the top of the axes.
The text was updated successfully, but these errors were encountered: