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

Skip to content

Commit 3f92f43

Browse files
authored
Merge pull request #18542 from brunobeltran/joinstyle_vlidation
CLEANUP: validate join/cap style centrally
2 parents beacf38 + fab81f4 commit 3f92f43

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343

4444
import matplotlib as mpl
4545
from matplotlib import (
46-
_api, backend_tools as tools, cbook, colors, textpath, tight_bbox,
46+
backend_tools as tools, cbook, colors, textpath, tight_bbox,
4747
transforms, widgets, get_backend, is_interactive, rcParams)
4848
from matplotlib._pylab_helpers import Gcf
4949
from matplotlib.backend_managers import ToolManager
50-
from matplotlib.transforms import Affine2D
51-
from matplotlib.path import Path
5250
from matplotlib.cbook import _setattr_cm
51+
from matplotlib.path import Path
52+
from matplotlib.rcsetup import validate_joinstyle, validate_capstyle
53+
from matplotlib.transforms import Affine2D
5354

5455

5556
_log = logging.getLogger(__name__)
@@ -914,7 +915,7 @@ def set_antialiased(self, b):
914915

915916
def set_capstyle(self, cs):
916917
"""Set the capstyle to be one of ('butt', 'round', 'projecting')."""
917-
_api.check_in_list(['butt', 'round', 'projecting'], cs=cs)
918+
validate_capstyle(cs)
918919
self._capstyle = cs
919920

920921
def set_clip_rectangle(self, rectangle):
@@ -982,7 +983,7 @@ def set_foreground(self, fg, isRGBA=False):
982983

983984
def set_joinstyle(self, js):
984985
"""Set the join style to be one of ('miter', 'round', 'bevel')."""
985-
_api.check_in_list(['miter', 'round', 'bevel'], js=js)
986+
validate_joinstyle(js)
986987
self._joinstyle = js
987988

988989
def set_linewidth(self, w):

0 commit comments

Comments
 (0)