When wire is coiled on the plastic tube and current flow through that wire then the system will behave like a solenoid in which current flows through the coiled wires and then it produce magnetic field along the axis of solenoid
So here it will also produce magnetic field along the axis of solenoid and then due to this magnetic field the compass placed inside the tube will experience torque on its needle due to which it will have tendency to oriented along the direction of magnetic field.
So here we can say that compass needle will lie along the axis of the plastic tube.
here magnetic field along the axis of tube will be given same as solenoid which is given as

so here direction of compass needle is axis of the tube