From 3f23531623e382313f23fbca7cdd2188b8c0c2af Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 17 Feb 2022 12:07:26 +0100 Subject: [PATCH] Remove _point_size_reduction. As implied by the comment, it may not be worth having this as a separate variable. --- lib/matplotlib/markers.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/matplotlib/markers.py b/lib/matplotlib/markers.py index beb09c9d8bed..d0f55fc037f0 100644 --- a/lib/matplotlib/markers.py +++ b/lib/matplotlib/markers.py @@ -222,9 +222,6 @@ class MarkerStyle: fillstyles = ('full', 'left', 'right', 'bottom', 'top', 'none') _half_fillstyles = ('left', 'right', 'bottom', 'top') - # TODO: Is this ever used as a non-constant? - _point_size_reduction = 0.5 - _unset = object() # For deprecation of MarkerStyle(). def __init__(self, marker=_unset, fillstyle=None, @@ -553,8 +550,8 @@ def _set_mathtext_path(self): def _half_fill(self): return self.get_fillstyle() in self._half_fillstyles - def _set_circle(self, reduction=1.0): - self._transform = Affine2D().scale(0.5 * reduction) + def _set_circle(self, size=1.0): + self._transform = Affine2D().scale(0.5 * size) self._snap_threshold = np.inf if not self._half_fill(): self._path = Path.unit_circle() @@ -565,6 +562,9 @@ def _set_circle(self, reduction=1.0): {'right': 0, 'top': 90, 'left': 180, 'bottom': 270}[fs]) self._alt_transform = self._transform.frozen().rotate_deg(180.) + def _set_point(self): + self._set_circle(size=0.5) + def _set_pixel(self): self._path = Path.unit_rectangle() # Ideally, you'd want -0.5, -0.5 here, but then the snapping @@ -579,9 +579,6 @@ def _set_pixel(self): self._transform = Affine2D().translate(-0.49999, -0.49999) self._snap_threshold = None - def _set_point(self): - self._set_circle(reduction=self._point_size_reduction) - _triangle_path = Path([[0, 1], [-1, -1], [1, -1], [0, 1]], closed=True) # Going down halfway looks to small. Golden ratio is too far. _triangle_path_u = Path([[0, 1], [-3/5, -1/5], [3/5, -1/5], [0, 1]],