FIX: keep sub-pixel line marks visible when snapping (#20243) · matplotlib/matplotlib@eec0fee · GitHub
Skip to content

Commit eec0fee

Browse files
committed
FIX: keep sub-pixel line marks visible when snapping (#20243)
PathSnapper rounds each vertex to the nearest pixel. A line mark shorter than one pixel then has both endpoints rounded onto the same pixel, so it collapses to zero length and is not drawn at all. eventplot builds every event as its own two-point segment, so plotting many closely spaced events silently dropped most of them. When the opening LINETO of a subpath snaps onto its MOVETO even though the raw segment was non-degenerate, extend the endpoint by one pixel along the segment's dominant axis so a single pixel is still drawn. Limiting this to the first segment of a subpath leaves polygon outlines (bars, markers, grids) snapping exactly as before.
1 parent aecee0d commit eec0fee

2 files changed

Lines changed: 77 additions & 3 deletions

File tree

lib/matplotlib/tests/test_axes.py

Lines changed: 32 additions & 0 deletions

src/path_converters.h

Lines changed: 45 additions & 3 deletions

0 commit comments

Comments
 (0)