Skip to content

Commit 4b2dc96

Browse files
committed
Try restoring linewidth
1 parent 7cbcd44 commit 4b2dc96

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/matplotlib/backends/backend_pgf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,17 @@ def draw_path(self, gc, path, transform, rgbFace=None):
477477
r"{\pgfqpoint{0in}{0in}}{\pgfqpoint{1in}{1in}}")
478478
_writeln(self.fh, r"\pgfusepath{clip}")
479479
scale = mpl.transforms.Affine2D().scale(self.dpi)
480+
# Store default PGF line width
481+
_writeln(self.fh, r"\newlength{\defaultpgflinewidth}")
482+
_writeln(self.fh,
483+
r"\setlength{\defaultpgflinewidth}{\pgflinewidth}")
480484
lw = (mpl.rcParams["hatch.linewidth"]
481485
* mpl_pt_to_in * latex_in_to_pt)
482486
_writeln(self.fh, r"\pgfsetlinewidth{%fpt}" % lw)
483487
self._print_pgf_path(None, gc.get_hatch_path(), scale)
484-
self._pgf_path_draw(stroke=True)
488+
self._pgf_path_draw()
489+
# Restore default PGF line width
490+
_writeln(self.fh, r"\pgfsetlinewidth{\defaultpgflinewidth}")
485491
_writeln(self.fh, r"\end{pgfscope}")
486492
_writeln(self.fh, r"}")
487493
# repeat pattern, filling the bounding rect of the path

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ def test_sketch_params():
368368
assert baseline in buf
369369

370370

371-
@needs_pgf_xelatex
372371
@pytest.mark.backend('pgf')
373372
@image_comparison(['hatch_linewidth'], extensions=['pdf'])
374373
def test_pgf_hatch_linewidth():

0 commit comments

Comments
 (0)