Skip to content

Commit

Permalink
Move the alias map dictionary into a common location.
Browse files Browse the repository at this point in the history
  • Loading branch information
WeatherGod committed May 4, 2016
1 parent 4657c8b commit 8e0963d
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@

rcParams = matplotlib.rcParams

_alias_map = {'color': ['c'],
'linewidth': ['lw'],
'linestyle': ['ls'],
'facecolor': ['fc'],
'edgecolor': ['ec'],
'markerfacecolor': ['mfc'],
'markeredgecolor': ['mec'],
'markeredgewidth': ['mew'],
'markersize': ['ms'],
}


def _plot_args_replacer(args, data):
if len(args) == 1:
Expand Down Expand Up @@ -1415,18 +1426,7 @@ def plot(self, *args, **kwargs):
self.cla()
lines = []

kwargs = cbook.normalize_kwargs(kwargs,
{
'color': ['c'],
'linewidth': ['lw'],
'linestyle': ['ls'],
'facecolor': ['fc'],
'edgecolor': ['ec'],
'markerfacecolor': ['mfc'],
'markeredgecolor': ['mec'],
'markeredgewidth': ['mew'],
'markersize': ['ms'],
})
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)

for line in self._get_lines(*args, **kwargs):
self.add_line(line)
Expand Down Expand Up @@ -4544,18 +4544,7 @@ def fill(self, *args, **kwargs):
if not self._hold:
self.cla()

kwargs = cbook.normalize_kwargs(kwargs,
{
'color': ['c'],
'linewidth': ['lw'],
'linestyle': ['ls'],
'facecolor': ['fc'],
'edgecolor': ['ec'],
'markerfacecolor': ['mfc'],
'markeredgecolor': ['mec'],
'markeredgewidth': ['mew'],
'markersize': ['ms'],
})
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)

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

0 comments on commit 8e0963d

Please sign in to comment.