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

Skip to content

Commit 37927b2

Browse files
committed
FIX : turn path snapping off on 'o' marker path
Set the _snap_threshold for 'o' markers to `np.inf` which effectively turns it off. This makes 'o' markers look more circular at all sizes at all dpi. This change subtly changed several tests. Closes #4421
1 parent 3c95554 commit 37927b2

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changed snap threshold for circle markers to inf
2+
````````````````````````````````````````````````
3+
4+
When drawing circle markers above some marker size (previously 6.0)
5+
the path used to generate the marker was snapped to pixel centers. However,
6+
this ends up distorting the marker away from a circle. By setting the
7+
snap threshold to inf snapping is never done on circles.
8+
9+
This change broke several tests, but is an improvement.

lib/matplotlib/markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def _half_fill(self):
346346

347347
def _set_circle(self, reduction=1.0):
348348
self._transform = Affine2D().scale(0.5 * reduction)
349-
self._snap_threshold = 6.0
349+
self._snap_threshold = np.inf
350350
fs = self.get_fillstyle()
351351
if not self._half_fill():
352352
self._path = Path.unit_circle()

0 commit comments

Comments
 (0)