FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Try restoring linewidth · matplotlib/matplotlib@b218519 · GitHub

Repository navigation

Commit b218519

Browse files
committed
Try restoring linewidth
1 parent 3c83748 commit b218519

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎lib/matplotlib/backends/backend_pgf.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,17 @@ def draw_path(self, gc, path, transform, rgbFace=None):
453453
r"{\pgfqpoint{0in}{0in}}{\pgfqpoint{1in}{1in}}")
454454
_writeln(self.fh, r"\pgfusepath{clip}")
455455
scale = mpl.transforms.Affine2D().scale(self.dpi)
456+
# Store default PGF line width
457+
_writeln(self.fh, r"\newlength{\defaultpgflinewidth}")
458+
_writeln(self.fh,
459+
r"\setlength{\defaultpgflinewidth}{\pgflinewidth}")
456460
lw = (mpl.rcParams["hatch.linewidth"]
457461
* mpl_pt_to_in * latex_in_to_pt)
458462
_writeln(self.fh, r"\pgfsetlinewidth{%fpt}" % lw)
459463
self._print_pgf_path(None, gc.get_hatch_path(), scale)
460464
self._pgf_path_draw(stroke=True)
465+
# Restore default PGF line width
466+
_writeln(self.fh, r"\pgfsetlinewidth{\defaultpgflinewidth}")
461467
_writeln(self.fh, r"\end{pgfscope}")
462468
_writeln(self.fh, r"}")
463469
# repeat pattern, filling the bounding rect of the path

‎lib/matplotlib/tests/test_backend_pgf.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ def test_sketch_params():
377377
assert baseline in buf
378378

379379

380-
<<<<<<< HEAD
381380
# test to make sure that the document font size is set consistently (see #26892)
382381
@needs_pgf_xelatex
383382
@pytest.mark.skipif(
@@ -400,7 +399,8 @@ def test_document_font_size():
400399
label=r'\normalsize the document font size is \the\fontdimen6\font'
401400
)
402401
plt.legend()
403-
=======
402+
403+
404404
@needs_pgf_xelatex
405405
@pytest.mark.backend('pgf')
406406
@image_comparison(['hatch_linewidth'], extensions=['pdf'])
@@ -409,4 +409,3 @@ def test_pgf_hatch_linewidth():
409409
mpl.rcParams['hatch.linewidth'] = 0.1
410410

411411
plt.bar(1, 1, color='white', edgecolor='black', hatch='/')
412-
>>>>>>> 7cbcd44f9a (Fix hatch linewidth in PGF)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL