|
30 | 30 | import matplotlib.transforms as mtransforms
|
31 | 31 | import matplotlib.tri as mtri
|
32 | 32 | import matplotlib.units as munits
|
33 |
| -from matplotlib import _preprocess_data, rcParams |
| 33 | +from matplotlib import _api, _preprocess_data, rcParams |
34 | 34 | from matplotlib.axes._base import (
|
35 | 35 | _AxesBase, _TransformedBoundsLocator, _process_plot_format)
|
36 | 36 | from matplotlib.axes._secondary_axes import SecondaryAxis
|
@@ -2084,7 +2084,7 @@ def step(self, x, y, *args, where='pre', data=None, **kwargs):
|
2084 | 2084 | -----
|
2085 | 2085 | .. [notes section required to get data note injection right]
|
2086 | 2086 | """
|
2087 |
| - cbook._check_in_list(('pre', 'post', 'mid'), where=where) |
| 2087 | + _api.check_in_list(('pre', 'post', 'mid'), where=where) |
2088 | 2088 | kwargs['drawstyle'] = 'steps-' + where
|
2089 | 2089 | return self.plot(x, y, *args, data=data, **kwargs)
|
2090 | 2090 |
|
@@ -2269,8 +2269,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
|
2269 | 2269 | # logic and drawing to bar(). It is considered internal and is
|
2270 | 2270 | # intentionally not mentioned in the docstring.
|
2271 | 2271 | orientation = kwargs.pop('orientation', 'vertical')
|
2272 |
| - cbook._check_in_list(['vertical', 'horizontal'], |
2273 |
| - orientation=orientation) |
| 2272 | + _api.check_in_list(['vertical', 'horizontal'], orientation=orientation) |
2274 | 2273 | log = kwargs.pop('log', False)
|
2275 | 2274 | label = kwargs.pop('label', '')
|
2276 | 2275 | tick_labels = kwargs.pop('tick_label', None)
|
@@ -2334,7 +2333,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
|
2334 | 2333 |
|
2335 | 2334 | # We will now resolve the alignment and really have
|
2336 | 2335 | # left, bottom, width, height vectors
|
2337 |
| - cbook._check_in_list(['center', 'edge'], align=align) |
| 2336 | + _api.check_in_list(['center', 'edge'], align=align) |
2338 | 2337 | if align == 'center':
|
2339 | 2338 | if orientation == 'vertical':
|
2340 | 2339 | try:
|
@@ -2680,8 +2679,7 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
|
2680 | 2679 | if not 1 <= len(args) <= 5:
|
2681 | 2680 | raise TypeError('stem expected between 1 and 5 positional '
|
2682 | 2681 | 'arguments, got {}'.format(args))
|
2683 |
| - cbook._check_in_list(['horizontal', 'vertical'], |
2684 |
| - orientation=orientation) |
| 2682 | + _api.check_in_list(['horizontal', 'vertical'], orientation=orientation) |
2685 | 2683 |
|
2686 | 2684 | if len(args) == 1:
|
2687 | 2685 | heads, = args
|
@@ -5467,7 +5465,7 @@ def _pcolorargs(funcname, *args, shading='flat'):
|
5467 | 5465 |
|
5468 | 5466 | _valid_shading = ['gouraud', 'nearest', 'flat', 'auto']
|
5469 | 5467 | try:
|
5470 |
| - cbook._check_in_list(_valid_shading, shading=shading) |
| 5468 | + _api.check_in_list(_valid_shading, shading=shading) |
5471 | 5469 | except ValueError as err:
|
5472 | 5470 | cbook._warn_external(f"shading value '{shading}' not in list of "
|
5473 | 5471 | f"valid values {_valid_shading}. Setting "
|
@@ -6487,11 +6485,10 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
|
6487 | 6485 | bins = rcParams['hist.bins']
|
6488 | 6486 |
|
6489 | 6487 | # Validate string inputs here to avoid cluttering subsequent code.
|
6490 |
| - cbook._check_in_list(['bar', 'barstacked', 'step', 'stepfilled'], |
6491 |
| - histtype=histtype) |
6492 |
| - cbook._check_in_list(['left', 'mid', 'right'], align=align) |
6493 |
| - cbook._check_in_list(['horizontal', 'vertical'], |
6494 |
| - orientation=orientation) |
| 6488 | + _api.check_in_list(['bar', 'barstacked', 'step', 'stepfilled'], |
| 6489 | + histtype=histtype) |
| 6490 | + _api.check_in_list(['left', 'mid', 'right'], align=align) |
| 6491 | + _api.check_in_list(['horizontal', 'vertical'], orientation=orientation) |
6495 | 6492 |
|
6496 | 6493 | if histtype == 'barstacked' and not stacked:
|
6497 | 6494 | stacked = True
|
@@ -7574,7 +7571,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
|
7574 | 7571 | """
|
7575 | 7572 | if marker is None and markersize is None and hasattr(Z, 'tocoo'):
|
7576 | 7573 | marker = 's'
|
7577 |
| - cbook._check_in_list(["upper", "lower"], origin=origin) |
| 7574 | + _api.check_in_list(["upper", "lower"], origin=origin) |
7578 | 7575 | if marker is None and markersize is None:
|
7579 | 7576 | Z = np.asarray(Z)
|
7580 | 7577 | mask = np.abs(Z) > precision
|
|
0 commit comments