diff --git a/skfem/visuals/matplotlib.py b/skfem/visuals/matplotlib.py index fa0991e61..d1e597bda 100644 --- a/skfem/visuals/matplotlib.py +++ b/skfem/visuals/matplotlib.py @@ -134,11 +134,12 @@ def plot_meshline(m: MeshLine, z: ndarray, **kwargs): # create new figure fig = plt.figure() ax = fig.add_subplot(111) - xs = [] - ys = [] else: ax = kwargs["ax"] + xs = [] + ys = [] + color = kwargs["color"] if "color" in kwargs else 'ko-' for y1, y2, s, t in zip(z[m.t[0]], z[m.t[1]],