8000 Add setter and getter methods for hatch linewidth in Patch · matplotlib/matplotlib@73fc655 · GitHub
[go: up one dir, main page]

Skip to content

Commit 73fc655

Browse files
committed
Add setter and getter methods for hatch linewidth in Patch
1 parent 6c1b786 commit 73fc655

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/patches.py

Lines changed: 10 additions & 0 deletions
< 8000 colgroup>
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def __init__(self, *,
7272
joinstyle = JoinStyle.miter
7373

7474
self._hatch_color = colors.to_rgba(mpl.rcParams['hatch.color'])
75+
self._hatch_linewidth = mpl.rcParams['hatch.linewidth']
7576
self._fill = bool(fill) # needed for set_facecolor call
7677
if color is not None:
7778
if edgecolor is not None or facecolor is not None:
@@ -571,6 +572,14 @@ def get_hatch(self):
571572
"""Return the hatching pattern."""
572573
return self._hatch
573574

575+
def set_hatch_linewidth(self, hatch_linewidth):
576+
"""Set the hatch linewidth"""
577+
self._hatch_linewidth = hatch_linewidth
578+
579+
def get_hatch_linewidth(self):
580+
"""Return the hatch linewidth"""
581+
return self._hatch_linewidth
582+
574583
def _draw_paths_with_artist_properties(
575584
self, renderer, draw_path_args_list):
576585
"""
@@ -605,6 +614,7 @@ def _draw_paths_with_artist_properties(
605614
if self._hatch:
606615
gc.set_hatch(self._hatch)
607616
gc.set_hatch_color(self._hatch_color)
617+
mhatch._set_hatch_linewidth(gc, self.get_hatch_linewidth())
608618

609619
if self.get_sketch_params() is not None:
610620
gc.set_sketch_params(*self.get_sketch_params())

0 commit comments

Comments
 (0)
0