Skip to content

Commit efd3493

Browse files
committed
Docstring/comments fixes & PEP8.
1 parent 70ec23a commit efd3493

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

lib/matplotlib/patches.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4066,7 +4066,7 @@ def set_dpi_cor(self, dpi_cor):
40664066
def get_dpi_cor(self):
40674067
"""
40684068
dpi_cor is currently used for linewidth-related things and
4069-
shrink factor. Mutation scale *is now* affected by this.
4069+
shrink factor. Mutation scale is affected by this.
40704070
"""
40714071

40724072
return self._dpi_cor
@@ -4218,11 +4218,12 @@ def get_path_in_displaycoord(self):
42184218
patchB=self.patchB,
42194219
shrinkA=self.shrinkA * dpi_cor,
42204220
shrinkB=self.shrinkB * dpi_cor
4221-
)
4221+
)
42224222
else:
42234223
_path = self.get_transform().transform_path(self._path_original)
42244224

4225-
_path, fillable = self.get_arrowstyle()(_path,
4225+
_path, fillable = self.get_arrowstyle()(
4226+
_path,
42264227
self.get_mutation_scale() * dpi_cor,
42274228
self.get_linewidth() * dpi_cor,
42284229
self.get_mutation_aspect()
@@ -4536,13 +4537,14 @@ def get_path_in_displaycoord(self):
45364537
patchB=self.patchB,
45374538
shrinkA=self.shrinkA * dpi_cor,
45384539
shrinkB=self.shrinkB * dpi_cor
4539-
)
4540+
)
45404541

4541-
_path, fillable = self.get_arrowstyle()(_path,
4542+
_path, fillable = self.get_arrowstyle()(
4543+
_path,
45424544
self.get_mutation_scale() * dpi_cor,
45434545
self.get_linewidth() * dpi_cor,
45444546
self.get_mutation_aspect()
4545-
)
4547+
)
45464548

45474549
return _path, fillable
45484550

lib/matplotlib/tests/test_arrow_patches.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import matplotlib.pyplot as plt
77
from matplotlib.testing.decorators import image_comparison
8-
import matplotlib.patches as mpatches # adopting scipy import conventions
8+
import matplotlib.patches as mpatches
99

1010

1111
def draw_arrow(ax, t, r):
@@ -54,7 +54,7 @@ def test_boxarrow():
5454

5555
def prepare_fancyarrow_dpi_cor_test():
5656
"""
57-
Convenience function that prepares and return a FancyArrowPatch. It aims
57+
Convenience function that prepares and returns a FancyArrowPatch. It aims
5858
at being used to test that the size of the arrow head does not depend on
5959
the DPI value of the exported picture.
6060
@@ -76,7 +76,7 @@ def prepare_fancyarrow_dpi_cor_test():
7676
def test_fancyarrow_dpi_cor_100dpi():
7777
"""
7878
Check the export of a FancyArrowPatch @ 100 DPI. FancyArrowPatch is
79-
instanciated through a dedicated function because another similar test
79+
instantiated through a dedicated function because another similar test
8080
checks a similar export but with a different DPI value.
8181
8282
Remark: test only a rasterized format.

lib/matplotlib/text.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,14 +2158,7 @@ def _update_position_xytext(self, renderer, xy_pixel):
21582158
" use 'headlength' to set the head length in points.")
21592159
headlength = d.pop('headlength', 12)
21602160

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

0 commit comments

Comments
 (0)