Skip to content

Remove _point_size_reduction. #22480

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

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Changes from all commits
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
13 changes: 5 additions & 8 deletions lib/matplotlib/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(<noargs>).

def __init__(self, marker=_unset, fillstyle=None,
Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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]],
Expand Down