  When a subhalo interacts with a cold stellar stream it perturbs its otherwise
nearly smooth distribution of stars, and this leads to the creation of a gap.
The properties of such gaps depend on the parameters of the interaction. Their
characterisation could thus lead to the determination of the mass spectrum of
the perturbers and possibly reveal the existence of dark subhalos orbiting the
Milky Way. Our goal is to construct a fully analytical model of the formation
and evolution of gaps embedded in streams orbiting in a realistic Milky Way
potential. To this end, we extend the model of Helmi & Koppelman (2016) for
spherical potentials, and predict the properties of gaps in streams evolving in
axisymmetric St\"ackel potentials. We make use of action-angles and their
simple behaviour to calculate the divergence of initially nearby orbits
slightly perturbed by the interaction with a subhalo. Our model, corroborated
by N-body experiments, predicts that the size of a gap grows linearly with
time. We obtain analytical expressions for the dependencies of the growth rate
on the orbit of the stream, the properties of the subhalo (mass, scale-radius),
and the geometry of the encounter (relative velocity, impact parameter). We
find that the density at the centre of the gap decreases with time as a
power-law in the same way as the density of a stream. This results in the
density-contrast between a pristine and a perturbed stream on the same orbit
asymptotically reaching a constant value dependent only on the encounter
parameters. We find that at a fixed age, smallish gaps are sensitive mostly to
the mass of the subhalo, while gaps formed by subhalo flybys with a low
relative velocity, or when the stream and subhalo move parallel, are degenerate
to the encounter parameters.
