For mapping the magnetic field of a bar magnet, place the bar magnet on a sheet of paper. Take a small compass needle. Place it close to one of the poles, say South. Mark by pencil dots, A and B, the positions, N, S of the ends of the compass needle. Shift the compass needle so that its n pole touches B. Mark the new position C of a S pole of the compass needle. Repeat this process to obtain a series of dots as shown in Fig. Join these points by a smooth curve. This is one magnetic line of force. Similarly, other magnetic lines of force can be drawn. Fig. shows the pattern of field lines around a bar magnet.

It should be clearly understood that the field lines exist in all the space around the magnet. In the figure, these lines are confined only in the plane of the paper.
Fig. shows the pattern of magnetic lines of force due to a straight solenoid carrying current. Comparison of the two field patterns shows that a current carrying solenoid behaves like a bar magnet. Looking at a face, if the current is anticlockwise, the face has north polarity and if the current is clockwise, the face has south polarity; Fig.

Thus a current carrying solenoid from outside resembles a bar magnet inside the solenoid, there is a strong magnetic field which can magnetise a specimen. Solenoid is hollow from inside whereas the bar magnet is solid.