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

Skip to content

Commit 695e1e1

Browse files
committed
use validate_[cap/join]style
1 parent 60179ac commit 695e1e1

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

lib/matplotlib/collections.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import matplotlib as mpl
1717
from . import (_path, artist, cbook, cm, colors as mcolors, docstring,
1818
lines as mlines, path as mpath, transforms)
19+
from .rcsetup import validate_joinstyle, validate_capstyle
1920
import warnings
2021

2122

@@ -599,7 +600,7 @@ def set_capstyle(self, cs):
599600
cs : {'butt', 'round', 'projecting'}
600601
The capstyle
601602
"""
602-
cbook._check_in_list(('butt', 'round', 'projecting'), capstyle=cs)
603+
validate_capstyle(cs)
603604
self._capstyle = cs
604605

605606
def get_capstyle(self):
@@ -614,7 +615,7 @@ def set_joinstyle(self, js):
614615
js : {'miter', 'round', 'bevel'}
615616
The joinstyle
616617
"""
617-
cbook._check_in_list(('miter', 'round', 'bevel'), joinstyle=js)
618+
validate_joinstyle(js)
618619
self._joinstyle = js
619620

620621
def get_joinstyle(self):

lib/matplotlib/lines.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
_to_unmasked_float_array, ls_mapper, ls_mapper_r, STEP_LOOKUP_MAP)
1717
from .markers import MarkerStyle
1818
from .path import Path
19+
from .rcsetup import validate_joinstyle, validate_capstyle
1920
from .transforms import (
2021
Affine2D, Bbox, BboxTransformFrom, BboxTransformTo, TransformedPath)
2122

@@ -1352,8 +1353,7 @@ def set_dash_joinstyle(self, s):
13521353
s : {'miter', 'round', 'bevel'}
13531354
For examples see :doc:`/gallery/lines_bars_and_markers/joinstyle`.
13541355
"""
1355-
s = mpl.rcsetup._deprecate_case_insensitive_join_cap(s)
1356-
cbook._check_in_list(self.validJoin, s=s)
1356+
validate_joinstyle(s)
13571357
if self._dashjoinstyle != s:
13581358
self.stale = True
13591359
self._dashjoinstyle = s
@@ -1367,8 +1367,7 @@ def set_solid_joinstyle(self, s):
13671367
s : {'miter', 'round', 'bevel'}
13681368
For examples see :doc:`/gallery/lines_bars_and_markers/joinstyle`.
13691369
"""
1370-
s = mpl.rcsetup._deprecate_case_insensitive_join_cap(s)
1371-
cbook._check_in_list(self.validJoin, s=s)
1370+
validate_joinstyle(s)
13721371
if self._solidjoinstyle != s:
13731372
self.stale = True
13741373
self._solidjoinstyle = s
@@ -1398,8 +1397,7 @@ def set_dash_capstyle(self, s):
13981397
s : {'butt', 'round', 'projecting'}
13991398
For examples see :doc:`/gallery/lines_bars_and_markers/joinstyle`.
14001399
"""
1401-
s = mpl.rcsetup._deprecate_case_insensitive_join_cap(s)
1402-
cbook._check_in_list(self.validCap, s=s)
1400+
validate_capstyle(s)
14031401
if self._dashcapstyle != s:
14041402
self.stale = True
14051403
self._dashcapstyle = s
@@ -1413,8 +1411,7 @@ def set_solid_capstyle(self, s):
14131411
s : {'butt', 'round', 'projecting'}
14141412
For examples see :doc:`/gallery/lines_bars_and_markers/joinstyle`.
14151413
"""
1416-
s = mpl.rcsetup._deprecate_case_insensitive_join_cap(s)
1417-
cbook._check_in_list(self.validCap, s=s)
1414+
validate_capstyle(s)
14181415
if self._solidcapstyle != s:
14191416
self.stale = True
14201417
self._solidcapstyle = s

lib/matplotlib/patches.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
get_parallels, inside_circle, make_wedged_bezier2,
1515
split_bezier_intersecting_with_closedpath, split_path_inout)
1616
from .path import Path
17+
from .rcsetup import validate_joinstyle, validate_capstyle
1718

1819

1920
@cbook._define_aliases({
@@ -461,8 +462,7 @@ def set_capstyle(self, s):
461462
----------
462463
s : {'butt', 'round', 'projecting'}
463464
"""
464-
s = mpl.rcsetup._deprecate_case_insensitive_join_cap(s)
465-
cbook._check_in_list(self.validCap, capstyle=s)
465+
validate_capstyle(s)
466466
self._capstyle = s
467467
self.stale = True
468468

@@ -477,8 +477,7 @@ def set_joinstyle(self, s):
477477
----------
478478
s : {'miter', 'round', 'bevel'}
479479
"""
480-
s = mpl.rcsetup._deprecate_case_insensitive_join_cap(s)
481-
cbook._check_in_list(self.validJoin, joinstyle=s)
480+
validate_joinstyle(s)
482481
self._joinstyle = s
483482
self.stale = True
484483

0 commit comments

Comments
 (0)