  We use a symmetry-motivated approach to analysing X-ray pair distribution
functions to study the mechanism of negative thermal expansion in two
ReO$_3$-like compounds; ScF$_3$ and CaZrF$_6$. Both average and local structure
suggest that it is the flexibility of M-F-M linkages (M = Ca, Zr, Sc) due to
dynamic rigid and semi-rigid "scissoring" modes that facilitates the observed
NTE behaviour. The amplitudes of these dynamic distortions are greater for
CaZrF$_6$ than for ScF$_3$, which corresponds well with the larger magnitude of
the thermal expansion reported in the literature for the former. We show that
this flexbility is enhanced in CaZrF$_6$ due to the rock-salt ordering mixing
the characters of two of these scissoring modes. Additionally, we show that in
ScF$_3$ anharmonic coupling between the modes responsible for the structural
flexibility and the rigid unit modes contributes to the unusually high NTE
behaviour in this material.
