Magnetometer moving along a line with different measurement?
The earth's magnetic field is weak and many electrical appliances and current conductors (power lines, power cords) also generate magnetic fields. Do your test outdoors, away from any power lines, cars, mobile phones, etc.