diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 95ba91af12ce..d4323a53f99e 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -796,6 +796,9 @@ def draw(self, renderer): self.get_markerfacecolor(), "none")): ec_rgba = ec_rgba[:3] + (fc_rgba[3],) gc.set_foreground(ec_rgba, isRGBA=True) + if self.get_sketch_params() is not None: + scale, length, randomness = self.get_sketch_params() + gc.set_sketch_params(scale/2, length/2, 2*randomness) marker = self._marker @@ -836,7 +839,6 @@ def draw(self, renderer): else: # Don't scale for pixels, and don't stroke them marker_trans = marker_trans.scale(w) - renderer.draw_markers(gc, marker_path, marker_trans, subsampled, affine.frozen(), fc_rgba) diff --git a/lib/matplotlib/tests/baseline_images/test_path/xkcd.pdf b/lib/matplotlib/tests/baseline_images/test_path/xkcd.pdf deleted file mode 100644 index 290886947443..000000000000 Binary files a/lib/matplotlib/tests/baseline_images/test_path/xkcd.pdf and /dev/null differ diff --git a/lib/matplotlib/tests/baseline_images/test_path/xkcd.png b/lib/matplotlib/tests/baseline_images/test_path/xkcd.png index 2900e407b038..fd486c42305f 100644 Binary files a/lib/matplotlib/tests/baseline_images/test_path/xkcd.png and b/lib/matplotlib/tests/baseline_images/test_path/xkcd.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_path/xkcd.svg b/lib/matplotlib/tests/baseline_images/test_path/xkcd.svg deleted file mode 100644 index 2fa9277fbb30..000000000000 --- a/lib/matplotlib/tests/baseline_images/test_path/xkcd.svg +++ /dev/null @@ -1,12164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/matplotlib/tests/baseline_images/test_path/xkcd_marker.png b/lib/matplotlib/tests/baseline_images/test_path/xkcd_marker.png new file mode 100644 index 000000000000..c4224f74c1ec Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_path/xkcd_marker.png differ diff --git a/lib/matplotlib/tests/test_path.py b/lib/matplotlib/tests/test_path.py index fe9067b635c7..cc988caf3f9d 100644 --- a/lib/matplotlib/tests/test_path.py +++ b/lib/matplotlib/tests/test_path.py @@ -110,7 +110,8 @@ def test_make_compound_path_empty(): assert r.vertices.shape == (0, 2) -@image_comparison(baseline_images=['xkcd'], remove_text=True) +@image_comparison(baseline_images=['xkcd'], extensions=['png'], + remove_text=True) def test_xkcd(): np.random.seed(0) @@ -122,6 +123,23 @@ def test_xkcd(): ax.plot(x, y) +@image_comparison(baseline_images=['xkcd_marker'], extensions=['png'], + remove_text=True) +def test_xkcd_marker(): + np.random.seed(0) + + x = np.linspace(0, 5, 8) + y1 = x + y2 = 5 - x + y3 = 2.5 * np.ones(8) + + with plt.xkcd(): + fig, ax = plt.subplots() + ax.plot(x, y1, '+', ms=10) + ax.plot(x, y2, 'o', ms=10) + ax.plot(x, y3, '^', ms=10) + + @image_comparison(baseline_images=['marker_paths'], extensions=['pdf'], remove_text=True) def test_marker_paths_pdf():