Added test for #529.
Creating copy of stream prior to plotting.

Some convenience functionality inside the plotting routine operates
inplace. This prevents changing the original data. Fixes #529.