# Why do the magnetic field lines of the earth go from south pole to north pole?

I saw these figures and could not get why the magnetic field lines are not pointing from the north pole towards the south pole but they do the opposite.

Or also this picture which is about magnetic characteristics of the sun says the same thing: