Sorry, I don't quite understand what you are saying.
NaN is not "at the top", will not be graphed and there won't be any "square wave pulse" (whatever that means). Only if you would use "Inf" instead of "NaN", a line would come down from +infinity if your plot has the dots connected by lines.
Still, As I said: An XY graph would be the right thing. Have you tried?