Make plot(x, y) work when x or y has NaN values

This addresses issue #16