diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index d0d7c9156c01..d41f1a6f254b 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -4807,7 +4807,8 @@ def step(self, x, y, *args, **kwargs): if where not in ('pre', 'post', 'mid'): raise ValueError("'where' argument to step must be " "'pre', 'post' or 'mid'") - kwargs['linestyle'] = 'steps-' + where + ln_sty = kwargs.pop('linestyle', '') + kwargs['linestyle'] = 'steps-' + where + ln_sty return self.plot(x, y, *args, **kwargs)