Modify closed orbit plot function to skip NaN orbits