Skip to content

Commit e2cfb52

Browse files
WeatherGodtacaswell
authored andcommitted
Move the alias map dictionary into a common location.
1 parent a3d782f commit e2cfb52

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

lib/matplotlib/axes/_axes.py

+13-24
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@
4444

4545
rcParams = matplotlib.rcParams
4646

47+
_alias_map = {'color': ['c'],
48+
'linewidth': ['lw'],
49+
'linestyle': ['ls'],
50+
'facecolor': ['fc'],
51+
'edgecolor': ['ec'],
52+
'markerfacecolor': ['mfc'],
53+
'markeredgecolor': ['mec'],
54+
'markeredgewidth': ['mew'],
55+
'markersize': ['ms'],
56+
}
57+
4758

4859
def _plot_args_replacer(args, data):
4960
if len(args) == 1:
@@ -1415,18 +1426,7 @@ def plot(self, *args, **kwargs):
14151426
self.cla()
14161427
lines = []
14171428

1418-
kwargs = cbook.normalize_kwargs(kwargs,
1419-
{
1420-
'color': ['c'],
1421-
'linewidth': ['lw'],
1422-
'linestyle': ['ls'],
1423-
'facecolor': ['fc'],
1424-
'edgecolor': ['ec'],
1425-
'markerfacecolor': ['mfc'],
1426-
'markeredgecolor': ['mec'],
1427-
'markeredgewidth': ['mew'],
1428-
'markersize': ['ms'],
1429-
})
1429+
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
14301430

14311431
for line in self._get_lines(*args, **kwargs):
14321432
self.add_line(line)
@@ -4544,18 +4544,7 @@ def fill(self, *args, **kwargs):
45444544
if not self._hold:
45454545
self.cla()
45464546

4547-
kwargs = cbook.normalize_kwargs(kwargs,
4548-
{
4549-
'color': ['c'],
4550-
'linewidth': ['lw'],
4551-
'linestyle': ['ls'],
4552-
'facecolor': ['fc'],
4553-
'edgecolor': ['ec'],
4554-
'markerfacecolor': ['mfc'],
4555-
'markeredgecolor': ['mec'],
4556-
'markeredgewidth': ['mew'],
4557-
'markersize': ['ms'],
4558-
})
4547+
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
45594548

45604549
patches = []
45614550
for poly in self._get_patches_for_fill(*args, **kwargs):

0 commit comments

Comments
 (0)