|
47 | 47 |
|
48 | 48 | rcParams = matplotlib.rcParams
|
49 | 49 |
|
50 |
| -_alias_map = {'color': ['c'], |
51 |
| - 'linewidth': ['lw'], |
52 |
| - 'linestyle': ['ls'], |
53 |
| - 'facecolor': ['fc'], |
54 |
| - 'edgecolor': ['ec'], |
55 |
| - 'markerfacecolor': ['mfc'], |
56 |
|
10000
- 'markeredgecolor': ['mec'], |
57 |
| - 'markeredgewidth': ['mew'], |
58 |
| - 'markersize': ['ms'], |
59 |
| - } |
60 |
| - |
61 | 50 |
|
62 | 51 | def _plot_args_replacer(args, data):
|
63 | 52 | if len(args) == 1:
|
@@ -1377,7 +1366,7 @@ def plot(self, *args, **kwargs):
|
1377 | 1366 | self.cla()
|
1378 | 1367 | lines = []
|
1379 | 1368 |
|
1380 |
| - kwargs = cbook.normalize_kwargs(kwargs, _alias_map) |
| 1369 | + kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) |
1381 | 1370 |
|
1382 | 1371 | for line in self._get_lines(*args, **kwargs):
|
1383 | 1372 | self.add_line(line)
|
@@ -1952,7 +1941,7 @@ def bar(self, *args, **kwargs):
|
1952 | 1941 | %(Rectangle)s
|
1953 | 1942 |
|
1954 | 1943 | """
|
1955 |
| - kwargs = cbook.normalize_kwargs(kwargs, mpatches._patch_alias_map) |
| 1944 | + kwargs = cbook.normalize_kwargs(kwargs, mpatches.Patch._alias_map) |
1956 | 1945 | # this is using the lambdas to do the arg/kwarg unpacking rather
|
1957 | 1946 | # than trying to re-implement all of that logic our selves.
|
1958 | 1947 | matchers = [
|
@@ -2796,7 +2785,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
|
2796 | 2785 |
|
2797 | 2786 | %(Line2D)s
|
2798 | 2787 | """
|
2799 |
| - kwargs = cbook.normalize_kwargs(kwargs, _alias_map) |
| 2788 | + kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) |
2800 | 2789 | # anything that comes in as 'None', drop so the default thing
|
2801 | 2790 | # happens down stream
|
2802 | 2791 | kwargs = {k: v for k, v in kwargs.items() if v is not None}
|
@@ -4692,7 +4681,8 @@ def fill(self, *args, **kwargs):
|
4692 | 4681 | if not self._hold:
|
4693 | 4682 | self.cla()
|
4694 | 4683 |
|
4695 |
| - kwargs = cbook.normalize_kwargs(kwargs, _alias_map) |
| 4684 | + # For compatibility(!), get aliases from Line2D rather than Patch. |
| 4685 | + kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map) |
4696 | 4686 |
|
4697 | 4687 | patches = []
|
4698 | 4688 | for poly in self._get_patches_for_fill(*args, **kwargs):
|
@@ -4764,12 +4754,11 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
|
4764 | 4754 | """
|
4765 | 4755 |
|
4766 | 4756 | if not rcParams['_internal.classic_mode']:
|
4767 |
| - color_aliases = mcoll._color_aliases |
4768 |
| - kwargs = cbook.normalize_kwargs(kwargs, color_aliases) |
4769 |
| - |
4770 |
| - if not any(c in kwargs for c in ('color', 'facecolors')): |
4771 |
| - fc = self._get_patches_for_fill.get_next_color() |
4772 |
| - kwargs['facecolors'] = fc |
| 4757 | + kwargs = cbook.normalize_kwargs( |
| 4758 | + kwargs, mcoll.Collection._alias_map) |
| 4759 | + if not any(c in kwargs for c in ('color', 'facecolor')): |
| 4760 | + kwargs['facecolor'] = \ |
| 4761 | + self._get_patches_for_fill.get_next_color() |
4773 | 4762 |
|
4774 | 4763 | # Handle united data, such as dates
|
4775 | 4764 | self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs)
|
@@ -4924,12 +4913,12 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
|
4924 | 4913 | """
|
4925 | 4914 |
|
4926 | 4915 | if not rcParams['_internal.classic_mode']:
|
4927 |
| - color_aliases = mcoll._color_aliases |
4928 |
| - kwargs = cbook.normalize_kwargs(kwargs, color_aliases) |
| 4916 | + kwargs = cbook.normalize_kwargs( |
| 4917 | + kwargs, mcoll.Collection._alias_map) |
| 4918 | + if not any(c in kwargs for c in ('color', 'facecolor')): |
| 4919 | + kwargs['facecolor'] = \ |
| 4920 | + self._get_patches_for_fill.get_next_color() |
4929 | 4921 |
|
4930 |
| - if not any(c in kwargs for c in ('color', 'facecolors')): |
4931 |
| - fc = self._get_patches_for_fill.get_next_color() |
4932 |
| - kwargs['facecolors'] = fc |
4933 | 4922 | # Handle united data, such as dates
|
4934 | 4923 | self._process_unit_info(ydata=y, xdata=x1, kwargs=kwargs)
|
4935 | 4924 | self._process_unit_info(xdata=x2)
|
|
0 commit comments