8000 Add linewidht setter and getter methods to Collections · matplotlib/matplotlib@fe41559 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe41559

Browse files
committed
Add linewidht setter and getter methods to Collections
1 parent ab5b0b1 commit fe41559

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/matplotlib/collections.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def __init__(self, *,
173173
self._edge_is_mapped = None
174174
self._mapped_colors = None # calculated in update_scalarmappable
175175
self._hatch_color = mcolors.to_rgba(mpl.rcParams['hatch.color'])
176+
self._hatch_linewidth = mpl.rcParams['hatch.linewidth']
176177
self.set_facecolor(facecolors)
177178
self.set_edgecolor(edgecolors)
178179
self.set_linewidth(linewidths)
@@ -363,6 +364,9 @@ def draw(self, renderer):
363364
if self._hatch:
364365
gc.set_hatch(self._hatch)
365366
gc.set_hatch_color(self._hatch_color)
367+
print(self._hatch_linewidth)
368+
print(self.get_hatch_linewidth())
369+
mhatch._set_hatch_linewidth(gc, self.get_hatch_linewidth())
366370

367371
if self.get_sketch_params() is not None:
368372
gc.set_sketch_params(*self.get_sketch_params())
@@ -541,6 +545,14 @@ def get_hatch(self):
541545
"""Return the current hatching pattern."""
542546
return self._hatch
543547

548+
def set_hatch_linewidth(self, lw):
549+
"""Set the hatch linewidth"""
550+
self._hatch_linewidth = lw
551+
552+
def get_hatch_linewidth(self):
553+
"""Return the hatch linewidth"""
554+
return self._hatch_linewidth
555+
544556
def set_offsets(self, offsets):
545557
"""
546558
Set the offsets for the collection.

0 commit comments

Comments
 (0)
0