Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79f3650

Browse files
committed
Fix bug introduced to hatching recently.
1 parent 342c028 commit 79f3650

4 files changed

Lines changed: 488 additions & 232 deletions

File tree

lib/matplotlib/hatch.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def set_vertices_and_codes(self, vertices, codes):
4343
class NorthEastHatch(HatchPatternBase):
4444
def __init__(self, hatch, density):
4545
self.num_lines = (hatch.count('/') + hatch.count('x') + hatch.count('X')) * density
46-
self.num_vertices = (self.num_lines + 1) * 2
46+
if self.num_lines:
47+
self.num_vertices = (self.num_lines + 1) * 2
48+
else:
49+
self.num_vertices = 0
4750

4851
def set_vertices_and_codes(self, vertices, codes):
4952
steps = np.linspace(-0.5, 0.5, self.num_lines + 1, True)
@@ -58,6 +61,10 @@ class SouthEastHatch(HatchPatternBase):
5861
def __init__(self, hatch, density):
5962
self.num_lines = (hatch.count('\\') + hatch.count('x') + hatch.count('X')) * density
6063
self.num_vertices = (self.num_lines + 1) * 2
64+
if self.num_lines:
65+
self.num_vertices = (self.num_lines + 1) * 2
66+
else:
67+
self.num_vertices = 0
6168

6269
def set_vertices_and_codes(self, vertices, codes):
6370
steps = np.linspace(-0.5, 0.5, self.num_lines + 1, True)
Binary file not shown.
147 Bytes
Loading

0 commit comments

Comments
 (0)