In this paper we examine the effects of an axial magnetic field on electron betatron oscillations in an undulator magnet. The electron betatron oscillations give rise to several betatron harmonics and reduce the spectral intensity at odd harmonics. An axial magnetic field suppresses these parasitic harmonics thereby improving the intensity.