Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Patch issue #6035 #6054

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 12 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Should fix broken unit tests 'polar_axes' and 'polar_coords' in test_…
…axes
  • Loading branch information
Adrien VINCENT authored and afvincent committed May 14, 2016
commit 903348ab04143b452fdccac76f5634cecf3f08c7
16 changes: 11 additions & 5 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -2163,11 +2163,17 @@ def _update_position_xytext(self, renderer, xy_pixel):
" use 'headlength' to set the head length in points.")
headlength = d.pop('headlength', 12)

to_style = self.figure.dpi / (72 * ms)

stylekw = dict(head_length=headlength * to_style,
head_width=headwidth * to_style,
tail_width=width * to_style)
# Old way:
Copy link
Member

Choose a reason for hiding this comment

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

please remove this comment block

If anyone has to do forensics on this part of the code recursive git-blame is their friend. I think going forward the discussion of old and new way will just lead to confusion

# ms_pix = renderer.points_to_pixels(ms)
# to_style = self.figure.dpi / (72 * ms_pix)
# NB: is there a reason to use self.figure.dpi / (72 * ms_pix)
# instead of renderer.points_to_pixels(1.) / ms_pix? Both
# should be equal to '1 / ms', shouldn't they (by the way)?
#
# New way: '* to_style' <- '/ ms' (ms is now still in pts here)
stylekw = dict(head_length=headlength / ms,
head_width=headwidth / ms,
tail_width=width / ms)

self.arrow_patch.set_arrowstyle('simple', **stylekw)

Expand Down