Dependence of magnetic field generation by thermal convection on the rotation rate