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

added dashed hatch pattern#28072

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

Open
ShivamPathak99 wants to merge7 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromShivamPathak99:hatch
Open
Show file tree
Hide file tree
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
16 changes: 14 additions & 2 deletionslib/matplotlib/hatch.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -167,6 +167,17 @@ def __init__(self, hatch, density):
self.shape_codes[0] = Path.MOVETO
super().__init__(hatch, density)


class Dashes(Shapes):
size = 0.35

def __init__(self, hatch, density):
self.num_rows = (hatch.count('_')) * density
path = Path([[0, 0], [1, 0]], [Path.MOVETO, Path.LINETO])
self.shape_vertices = path.vertices
self.shape_codes = path.codes
super().__init__(hatch, density)

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


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
7 changes: 7 additions & 0 deletionslib/matplotlib/hatch.pyi
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,4 +65,11 @@ class Stars(Shapes):
shape_codes: np.ndarray
def __init__(self, hatch: str, density: int) -> None: ...

class Dashes(Shapes):
size: float
num_rows: int
shape_vertices: np.ndarray
shape_codes: np.ndarray
def __init__(self, hatch: str, density: int) -> None: ...

def get_path(hatchpattern: str, density: int = ...) -> Path: ...
Loading

[8]ページ先頭

©2009-2025 Movatter.jp