create line segments for curvy plot