Skip to content

Commit 85d3ea9

Browse files
committed
No need to square just to take the square root.
1 parent 00b029e commit 85d3ea9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/markers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ def _set_nothing(self):
178178

179179
def _set_custom_marker(self, path):
180180
verts = path.vertices
181-
rescale = np.sqrt(max(np.max(verts[:,0]**2),
182-
np.max(verts[:,1]**2)))
181+
rescale = max(np.max(np.abs(verts[:,0])), np.max(np.abs(verts[:,1]))))
183182
self._transform = Affine2D().scale(1.0 / rescale)
184183
self._path = path
185184

0 commit comments

Comments
 (0)