From 260593da4725f8bd7e1474c7c6b760e86558e200 Mon Sep 17 00:00:00 2001 From: Ebubekir Date: Tue, 13 May 2025 19:26:22 +0930 Subject: [PATCH 1/3] Bug Fix For Issue 20243 --- lib/matplotlib/axes/_axes.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 285eab153ecc..3b23c8d9fadc 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -1397,6 +1397,15 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1, else: positions = [np.asanyarray(positions)] + if 'snap' not in kwargs and len(positions) > 200: + _log.warning( + "eventplot: Number of events (%d) exceeds 200. Snapping has " + "been turned off. Snapping may still be turned on manually, " + "but runs the risk of 'missing' data in the outputted graph.", + len(positions)) + kwargs['snap'] = False + kwargs['antialiaseds'] = True + poss = [] for position in positions: poss += self._process_unit_info([("x", position)], kwargs) From db150f25f9ecb737d89a300cf5972a2f96d4b7d1 Mon Sep 17 00:00:00 2001 From: Ebubekir Date: Tue, 20 May 2025 20:24:50 +0930 Subject: [PATCH 2/3] Updating Bug Fix to Disregard Event Count --- lib/matplotlib/axes/_axes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 3b23c8d9fadc..c2a2cec456ae 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -1397,11 +1397,11 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1, else: positions = [np.asanyarray(positions)] - if 'snap' not in kwargs and len(positions) > 200: + if 'snap' not in kwargs: _log.warning( - "eventplot: Number of events (%d) exceeds 200. Snapping has " - "been turned off. Snapping may still be turned on manually, " - "but runs the risk of 'missing' data in the outputted graph.", + "eventplot: Snapping has been turned off. Snapping may still " + "be turned on manually, but runs the risk of 'missing' data " + "in the outputted graph.", len(positions)) kwargs['snap'] = False kwargs['antialiaseds'] = True From c7004529581ea5dad800f6cf25e207bb74f89913 Mon Sep 17 00:00:00 2001 From: Ebubekir Date: Thu, 22 May 2025 20:02:25 +0930 Subject: [PATCH 3/3] Bug Fix Issue 20243 Cleaned Up --- lib/matplotlib/axes/_axes.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index f4b3143198cd..26db7938713c 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -1401,8 +1401,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1, _log.warning( "eventplot: Snapping has been turned off. Snapping may still " "be turned on manually, but runs the risk of 'missing' data " - "in the outputted graph.", - len(positions)) + "in the outputted graph.") kwargs['snap'] = False kwargs['antialiaseds'] = True