def plot_vec(axis, step, var):
xmesh, ymesh, vec1, vec2 = get_meshes_vec(step, var)<EOL>dipz = step.geom.nztot // <NUM_LIT:10><EOL>if conf.field.shift:<EOL><INDENT>vec1 = np.roll(vec1, conf.field.shift, axis=<NUM_LIT:0>)<EOL>vec2 = np.roll(vec2, conf.field.shift, axis=<NUM_LIT:0>)<EOL><DEDENT>if step.geom.spherical or conf.plot.ratio is None:<EOL><INDENT>dipx = dipz<EOL><DEDENT>else:<EOL><INDENT>dipx = step.geom.nytot if step.geom.twod_yz else step.geom.nxtot<EOL>dipx = int(dipx // <NUM_LIT:10> * conf.plot.ratio) + <NUM_LIT:1><EOL><DEDENT>axis.quiver(xmesh[::dipx, ::dipz], ymesh[::dipx, ::dipz],<EOL>vec1[::dipx, ::dipz], vec2[::dipx, ::dipz],<EOL>linewidths=<NUM_LIT:1>)<EOL>
Plot vector field.

    Args:
        axis (:class:`matplotlib.axes.Axes`): the axis handler of an
            existing matplotlib figure where the vector field should
            be plotted.
        step (:class:`~stagpy.stagyydata._Step`): a step of a StagyyData
            instance.
        var (str): the vector field name.