@@ -921,7 +921,7 @@ def set_linewidth(self, w):
921
921
"""
922
922
self ._linewidth = w
923
923
924
- def set_linestyle (self , linestyle ):
924
+ def set_linestyle (self , ls ):
925
925
"""
926
926
Set the linestyle of the line (also accepts drawstyles,
927
927
e.g., ``'steps--'``)
@@ -959,36 +959,36 @@ def set_linestyle(self, linestyle):
959
959
ls : { '-', '--', '-.', ':'} and more see description
960
960
The line style.
961
961
"""
962
- if not is_string_like (linestyle ):
963
- if len (linestyle ) != 2 :
962
+ if not is_string_like (ls ):
963
+ if len (ls ) != 2 :
964
964
raise ValueError ()
965
965
966
- self .set_dashes (linestyle [1 ])
966
+ self .set_dashes (ls [1 ])
967
967
self ._linestyle = "--"
968
968
return
969
969
970
970
for ds in self .drawStyleKeys : # long names are first in the list
971
- if linestyle .startswith (ds ):
971
+ if ls .startswith (ds ):
972
972
self .set_drawstyle (ds )
973
- if len (linestyle ) > len (ds ):
974
- linestyle = linestyle [len (ds ):]
973
+ if len (ls ) > len (ds ):
974
+ ls = ls [len (ds ):]
975
975
else :
976
- linestyle = '-'
976
+ ls = '-'
977
977
break
978
978
979
- if linestyle in [' ' , '' , 'none' ]:
980
- linestyle = 'None'
979
+ if ls in [' ' , '' , 'none' ]:
980
+ ls = 'None'
981
981
982
- if linestyle not in self ._lineStyles :
982
+ if ls not in self ._lineStyles :
983
983
try :
984
- linestyle = ls_mapper_r [linestyle ]
984
+ ls = ls_mapper_r [ls ]
985
985
except KeyError :
986
986
raise ValueError (("You passed in an invalid linestyle, "
987
987
"`{}`. See "
988
988
"docs of Line2D.set_linestyle for "
989
- "valid values." ).format (linestyle ))
989
+ "valid values." ).format (ls ))
990
990
991
- self ._linestyle = linestyle
991
+ self ._linestyle = ls
992
992
993
993
@docstring .dedent_interpd
994
994
def set_marker (self , marker ):
0 commit comments