Strange behavior of plot---plot successful only if it is the last line of the code