  Cosmological observations are used to test for imprints of an ultra-light
axion-like field (ULA), with a range of potentials
$V(\phi)\propto[1-\cos(\phi/f)]^n$ set by the axion-field value $\phi$ and
decay constant $f$. Scalar field dynamics dictate that the field is initially
frozen and then begins to oscillate around its minimum when the Hubble
parameter drops below some critical value. For $n\!=\!1$, once dynamical, the
axion energy density dilutes as matter; for $n\!=\!2$ it dilutes as radiation
and for $n\!=\!3$ it dilutes faster than radiation. Both the homogeneous
evolution of the ULA and the dynamics of its linear perturbations are included,
using an effective fluid approximation generalized from the usual $n=1$ case.
ULA models are parameterized by the redshift $z_c$ when the field becomes
dynamical, the fractional energy density $f_{z_c} \equiv
\Omega_a(z_c)/\Omega_{\rm tot}(z_c)$ in the axion field at $z_c$, and the
effective sound speed $c_s^2$. Using Planck, BAO and JLA data, constraints on
$f_{z_c}$ are obtained. ULAs are degenerate with dark energy for all three
potentials if $1+z_c \lesssim 10$. When $3\times10^4 \gtrsim 1+z_c \gtrsim 10
$, $f_{z_c}$ is constrained to be $ \lesssim 0.004 $ for $n=1$ and $f_{z_c}
\lesssim 0.02 $ for the other two potentials. The constraints then relax with
increasing $z_c$. These results strongly constrain ULAs as a resolution to
cosmological tensions, such as discrepant measurements of the Hubble constant,
or the EDGES measurement of the global 21 cm signal.
