Plot of distance matrix, removement of unnecessary rows of the distance matrix