8000 Extended the convolution filter · matplotlib/matplotlib@df0cde3 · GitHub
[go: up one dir, main page]

Skip to content

Commit df0cde3

Browse files
authored
Extended the convolution filter
Changed the convolution filter from [1, 1] to [1, 1, 1] such that the mask is dilated on both sides, not only at the end.
1 parent 6429e9d commit df0cde3

Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def downsample(self, xstart, xend):
2525
mask = (self.origXData > xstart) & (self.origXData < xend)
2626
# dilate the mask by one to catch the points just outside
2727
# of the view range to not truncate the line
28-
mask = np.convolve([1, 1], mask, mode='same').astype(bool)
28+
mask = np.convolve([1, 1, 1], mask, mode='same').astype(bool)
2929
# sort out how many points to drop
3030
ratio = max(np.sum(mask) // self.max_points, 1)
3131