How do I obtain contour lines in a sequence.

Thank you. Using the Plot On Sorted Lines worked except for the connection between islands of the contours, I could import to Matlab and obtained the plot attached.
How could I identify each points belonging to different islands?