Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update hatch.py#27337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Arikad0 wants to merge1 commit intomatplotlib:mainfromArikad0:Temp1
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletionslib/matplotlib/hatch.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -167,6 +167,22 @@ def __init__(self, hatch, density):
self.shape_codes[0] = Path.MOVETO
super().__init__(hatch, density)

class DashedHatch(HatchPatternBase):
def __init__(self, hatch, density):
self.num_lines = int((hatch.count('_') + hatch.count('+')) * density)
self.num_vertices = self.num_lines * 2

def set_vertices_and_codes(self, vertices, codes):
steps, stepsize = np.linspace(0.0, 1.0, self.num_lines, False,
retstep=True)
steps += stepsize / 2.
vertices[0::2, 0] = steps
vertices[0::2, 1] = 0.0
vertices[1::2, 0] = steps
vertices[1::2, 1] = 1.0
codes[0::2] = Path.MOVETO
codes[1::2] = Path.LINETO

_hatch_types = [
HorizontalHatch,
VerticalHatch,
Expand All@@ -175,12 +191,13 @@ def __init__(self, hatch, density):
SmallCircles,
LargeCircles,
SmallFilledCircles,
Stars
Stars,
DashedHatch
]


def _validate_hatch_pattern(hatch):
valid_hatch_patterns = set(r'-+|/\xXoO.*')
valid_hatch_patterns = set(r'-+|/\xXoO.*_')
if hatch is not None:
invalids = set(hatch).difference(valid_hatch_patterns)
if invalids:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp