Skip to content

Fix negative annotations xycoords. #4019

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 1 commit into from

Conversation

myshen
Copy link
Contributor

@myshen myshen commented Jan 20, 2015

Use top-right as translation reference point when xycoords are given in
"point" or "pixel" and x or y are negative. Logic based on
_get_xy_legacy removed in a65151b.

@tacaswell tacaswell added this to the v1.4.3 milestone Jan 20, 2015
@tacaswell
Copy link
Member

Something looks wrong in the png output.

Use top-right as translation reference point when xycoords are given in
"point" or "pixel" and x or y are negative. Logic based on
_get_xy_legacy removed in a65151b.
@myshen
Copy link
Contributor Author

myshen commented Jan 22, 2015

I missed editing one of the _get_xy_transform calls, but I don't think that is the cause of weird PNG output. Running the same test without the changes to text.py results in similar weirdness. I think it has to do with the particular coordinates in the test and the DPI. I will update the request for the additional _get_xy_transform but am unsure of the PNG weirdness.

@tacaswell
Copy link
Member

I think the issue is just that the test strings fall on top of each other.
Tweaking the arguments should be enough.

On Thu, Jan 22, 2015, 08:18 Matt Shen notifications@github.com wrote:

I missed editing one of the _get_xy_transform calls, but I don't think
that is the cause of weird PNG output. Running the same test without the
changes to text.py results in similar weirdness. I think it has to do with
the particular coordinates in the test and the DPI. I will update the
request for the additional _get_xy_transform but am unsure of the PNG
weirdness.


Reply to this email directly or view it on GitHub
#4019 (comment)
.

@myshen
Copy link
Contributor Author

myshen commented Jan 22, 2015

162239f has the additional _get_xy_transform as wel as tweaked strings.

tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 26, 2015
    BUG : fix negative coords in annotation
@tacaswell
Copy link
Member

I am going to merge this on my local machine so that I can remove the pdf and svg tests (see tacaswell@d6e1577), I am just waiting for the tests to pass on travis before pushing to upstream.

@tacaswell
Copy link
Member

Merged as d6e1577

@tacaswell tacaswell closed this Jan 26, 2015
tacaswell added a commit that referenced this pull request Jan 26, 2015
    BUG : fix negative coords in annotation

Conflicts:
	lib/matplotlib/tests/test_text.py

cherry pick was too aggressive picking up tests from master
@tacaswell
Copy link
Member

back-ported as cf23500

tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jul 31, 2015
…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.
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jun 15, 2023
…_neg_coords""

This partially reverts commit 7b71257.

Too many tests were removed, restore the extra tests.
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jun 21, 2023
…_neg_coords""

This partially reverts commit 7b71257.

Too many tests were removed, restore the extra tests.
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jun 21, 2023
…_neg_coords""

This partially reverts commit 7b71257.

Too many tests were removed, restore the extra tests.
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Mar 6, 2024
…_neg_coords""

This partially reverts commit 7b71257.

Too many tests were removed, restore the extra tests.
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Mar 21, 2024
…_neg_coords""

This partially reverts commit 7b71257.

Too many tests were removed, restore the extra tests.
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