class CustomHorizontalHatch(matplotlib.hatch.HorizontalHatch):

    def __init__(self, hatch, density):
        char_count = hatch.count('_')
if char_count > 0:
    self.num_lines = int(1.0 / char_count * density)
else:
    self.num_lines = 0
self.num_vertices = self.num_lines * 2
How to decrease hatch density in matplotlib