|
48 | 48 |
|
49 | 49 | rcParams = matplotlib.rcParams |
50 | 50 |
|
51 | | -_alias_map = {'color': ['c'], |
52 | | - 'linewidth': ['lw'], |
53 | | - 'linestyle': ['ls'], |
54 | | - 'facecolor': ['fc'], |
55 | | - 'edgecolor': ['ec'], |
56 | | - 'markerfacecolor': ['mfc'], |
57 | | - 'markeredgecolor': ['mec'], |
58 | | - 'markeredgewidth': ['mew'], |
59 | | - 'markersize': ['ms'], |
60 | | - } |
61 | | - |
62 | 51 |
|
63 | 52 | def _plot_args_replacer(args, data): |
64 | 53 | if len(args) == 1: |
@@ -1519,7 +1508,7 @@ def plot(self, *args, **kwargs): |
1519 | 1508 | self.cla() |
1520 | 1509 | lines = [] |
1521 | 1510 |
|
1522 | | - kwargs = cbook.normalize_kwargs(kwargs, _alias_map) |
| 1511 | + kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) |
1523 | 1512 |
|
1524 | 1513 | for line in self._get_lines(*args, **kwargs): |
1525 | 1514 | self.add_line(line) |
@@ -2090,7 +2079,7 @@ def bar(self, *args, **kwargs): |
2090 | 2079 | %(Rectangle)s |
2091 | 2080 |
|
2092 | 2081 | """ |
2093 | | - kwargs = cbook.normalize_kwargs(kwargs, mpatches._patch_alias_map) |
| 2082 | + kwargs = cbook.normalize_kwargs(kwargs, mpatches.Patch._alias_map) |
2094 | 2083 | # this is using the lambdas to do the arg/kwarg unpacking rather |
2095 | 2084 | # than trying to re-implement all of that logic our selves. |
2096 | 2085 | matchers = [ |
@@ -3035,7 +3024,7 @@ def errorbar(self, x, y, yerr=None, xerr=None, |
3035 | 3024 | .. [Notes section required for data comment. See #10189.] |
3036 | 3025 |
|
3037 | 3026 | """ |
3038 | | - kwargs = cbook.normalize_kwargs(kwargs, _alias_map) |
| 3027 | + kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) |
3039 | 3028 | # anything that comes in as 'None', drop so the default thing |
3040 | 3029 | # happens down stream |
3041 | 3030 | kwargs = {k: v for k, v in kwargs.items() if v is not None} |
@@ -4928,7 +4917,8 @@ def fill(self, *args, **kwargs): |
4928 | 4917 | if not self._hold: |
4929 | 4918 | self.cla() |
4930 | 4919 |
|
4931 | | - kwargs = cbook.normalize_kwargs(kwargs, _alias_map) |
| 4920 | + # For compatibility(!), get aliases from Line2D rather than Patch. |
| 4921 | + kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) |
4932 | 4922 |
|
4933 | 4923 | patches = [] |
4934 | 4924 | for poly in self._get_patches_for_fill(*args, **kwargs): |
@@ -5022,12 +5012,11 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False, |
5022 | 5012 |
|
5023 | 5013 | """ |
5024 | 5014 | if not rcParams['_internal.classic_mode']: |
5025 | | - color_aliases = mcoll._color_aliases |
5026 | | - kwargs = cbook.normalize_kwargs(kwargs, color_aliases) |
5027 | | - |
5028 | | - if not any(c in kwargs for c in ('color', 'facecolors')): |
5029 | | - fc = self._get_patches_for_fill.get_next_color() |
5030 | | - kwargs['facecolors'] = fc |
| 5015 | + kwargs = cbook.normalize_kwargs( |
| 5016 | + kwargs, mcoll.Collection._alias_map) |
| 5017 | + if not any(c in kwargs for c in ('color', 'facecolor')): |
| 5018 | + kwargs['facecolor'] = \ |
| 5019 | + self._get_patches_for_fill.get_next_color() |
5031 | 5020 |
|
5032 | 5021 | # Handle united data, such as dates |
5033 | 5022 | self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs) |
@@ -5204,12 +5193,12 @@ def fill_betweenx(self, y, x1, x2=0, where=None, |
5204 | 5193 |
|
5205 | 5194 | """ |
5206 | 5195 | if not rcParams['_internal.classic_mode']: |
5207 | | - color_aliases = mcoll._color_aliases |
5208 | | - kwargs = cbook.normalize_kwargs(kwargs, color_aliases) |
| 5196 | + kwargs = cbook.normalize_kwargs( |
| 5197 | + kwargs, mcoll.Collection._alias_map) |
| 5198 | + if not any(c in kwargs for c in ('color', 'facecolor')): |
| 5199 | + kwargs['facecolor'] = \ |
| 5200 | + self._get_patches_for_fill.get_next_color() |
5209 | 5201 |
|
5210 | | - if not any(c in kwargs for c in ('color', 'facecolors')): |
5211 | | - fc = self._get_patches_for_fill.get_next_color() |
5212 | | - kwargs['facecolors'] = fc |
5213 | 5202 | # Handle united data, such as dates |
5214 | 5203 | self._process_unit_info(ydata=y, xdata=x1, kwargs=kwargs) |
5215 | 5204 | self._process_unit_info(xdata=x2) |
|
0 commit comments