Skip to content

Commit 9e70828

Browse files
committed
Rename ls_mapperr to ls_mapper_r and add comment about the split of ls_mapper
1 parent 587cfd7 commit 9e70828

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/matplotlib/cbook.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,10 @@ def unmasked_index_ranges(mask, compressed=True):
21082108
(':', 'dotted')]
21092109

21102110
ls_mapper = dict(_linestyles)
2111-
ls_mapperr = dict([(ls[1], ls[0]) for ls in _linestyles])
2111+
# The ls_mapper maps short codes for line style to their full name used
2112+
# by backends
2113+
# The reverse mapper is for mapping full names to short ones
2114+
ls_mapper_r = dict([(ls[1], ls[0]) for ls in _linestyles])
21122115

21132116

21142117
def align_iterators(func, *iterables):

lib/matplotlib/lines.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from matplotlib import verbose
1717
from . import artist
1818
from .artist import Artist
19-
from .cbook import iterable, is_string_like, is_numlike, ls_mapperr
19+
from .cbook import iterable, is_string_like, is_numlike, ls_mapper_r
2020
from .colors import colorConverter
2121
from .path import Path
2222
from .transforms import Bbox, TransformedPath, IdentityTransform
@@ -972,8 +972,8 @@ def set_linestyle(self, linestyle):
972972
break
973973

974974
if linestyle not in self._lineStyles:
975-
if linestyle in ls_mapperr:
976-
linestyle = ls_mapperr[linestyle]
975+
if linestyle in ls_mapper_r:
976+
linestyle = ls_mapper_r[linestyle]
977977
else:
978978
verbose.report('Unrecognized line style %s, %s' %
979979
(linestyle, type(linestyle)))

0 commit comments

Comments
 (0)