Skip to content

Commit 2ab206f

Browse files
author
John McCullough
committed
Hatch linewidth for pdf and ps backends.
1 parent a7aaa83 commit 2ab206f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

lib/matplotlib/backends/backend_pdf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ def writeHatches(self):
11131113
0, 0, sidelen, sidelen, Op.rectangle,
11141114
Op.fill)
11151115

1116-
self.output(0.1, Op.setlinewidth)
1116+
self.output(rcParams['hatch.linewidth'], Op.setlinewidth)
11171117

11181118
# TODO: We could make this dpi-dependent, but that would be
11191119
# an API change

lib/matplotlib/backends/backend_ps.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ def create_hatch(self, hatch):
295295
if hatch in self._hatches:
296296
return self._hatches[hatch]
297297
name = 'H%d' % len(self._hatches)
298+
hatchwidth = rcParams['hatch.linewidth']
298299
self._pswriter.write("""\
299300
<< /PatternType 1
300301
/PaintType 2
@@ -305,7 +306,7 @@ def create_hatch(self, hatch):
305306
306307
/PaintProc {
307308
pop
308-
0 setlinewidth
309+
%(hatchwidth)f setlinewidth
309310
""" % locals())
310311
self._pswriter.write(
311312
self._convert_path(Path.hatch(hatch), Affine2D().scale(72.0),

lib/matplotlib/rcsetup.py

+3
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ def __call__(self, s):
399399
'patch.facecolor' : ['b', validate_color], # blue
400400
'patch.antialiased' : [True, validate_bool], # antialised (no jaggies)
401401

402+
# hatch props
403+
'hatch.linewidth' : [0.1, validate_float], # Hatch line width in points
404+
402405

403406
# font props
404407
'font.family' : ['sans-serif', str], # used by text object

0 commit comments

Comments
 (0)