Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixes issue #1960. Account for right/top spine data offset on transform ...#1964

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

cimarronm
Copy link
Contributor

...when doing spine.set_position(). Also includes a testcase for the data locations.

…on transform when doing spine.set_position(). Also includes a testcase for the data locations.
@@ -323,6 +323,8 @@ def _calc_offset_transform(self):
self._spine_transform = ('identity',
mtransforms.IdentityTransform())
elif position_type == 'data':
if self.spine_type in ('right', 'top'):
amount -= 1 # translate left by one to account for right/top data offset of one
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, the comment doesn't enlighten me. Do you know the root cause of this workaround? Is this one pixel? Are you certain that this isn't a snapping issue?

Apologies for the (possibly silly) questions - I would like to understand the underlyingneed for this change.

Copy link
Member

Choose a reason for hiding this comment

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

It's not one pixel -- it's in axes units which are (0, 1) across the entire axis. Maybe a better comment would be:

The right and top spines have a default position of 1 in axes coordinates.  When specifying the position in data coordinates, we need to calculate the position relative to 0.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

That is correct. I updated the code with Michael's suggested comment. Thanks@mdboom

# The right and top spines have a default position of 1 in
# axes coordinates. When specifying the position in data
# coordinates, we need to calculate the position relative to 0.
amount -= 1
Copy link
Member

Choose a reason for hiding this comment

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

Thanks@cimarronm - this ismuch clearer now.

@pelson
Copy link
Member

Just needs andoc/api/api_changes.rst entry since this will change some functionality (for the better - by fixing a bug) and I think it is good to go.

Nice work@cimarronm.

👍

@cimarronm
Copy link
ContributorAuthor

How about:

* Fixed a bug in setting the position for the right/top spine with data   position type. Previously, it would draw the right or top spine at  +1 data offset.

Let me know if that is good or want to improve the wording fordoc/api/api_changes.rst

@pelson
Copy link
Member

Let me know if that is good or want to improve the wording for

That sounds good to me. Theapi_changes.rst document is there for those who are finding problems when upgrading versions, so something short and to the point is exactly what is needed. Thanks@cimarronm

@cimarronm
Copy link
ContributorAuthor

Is this good to merge?

mdboom added a commit that referenced this pull requestMay 11, 2013
…_fixFixes issue#1960. Account for right/top spine data offset on transform ...
@mdboommdboom merged commitaf07100 intomatplotlib:masterMay 11, 2013
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@cimarronm@pelson@mdboom

[8]ページ先頭

©2009-2025 Movatter.jp