Skip to content

Commit f07ce7c

Browse files
committed
Dont require pattern lib if hatch cant be understood
1 parent 74fcbc1 commit f07ce7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tikzplotlib/_hatches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ def _mpl_hatch2pgfp_pattern(data, hatch, color_name, color_rgba):
9090
Output:
9191
draw_options - list, empty or with a post action string
9292
"""
93-
data["tikz libs"].add("patterns")
94-
9593
hatch = __validate_hatch(hatch)
9694
try:
9795
pgfplots_pattern = _MP_HATCH2PGF_PATTERN.get(hatch)
9896
except KeyError:
9997
warnings.warn("tikzplotlib: The hatch", hatch, "is ignored.")
10098
return data, []
10199

100+
data["tikz libs"].add("patterns")
101+
102102
pattern_options = [f"pattern={pgfplots_pattern}"]
103103
if color_name != "black":
104104
# PGFPlots render patterns in 'pattern color' (default: black)

0 commit comments

Comments
 (0)