A magnetic compass shows a deflection in its needle when it is placed near a current-carrying wire. The deflection in the needle will increase with an increase in electric current in the wire. So, when the switch is turned off, the deflection will reduce to zero since there will be no current flowing in the circuit.