2-D Wavelet output changing when using 'figure' command in Matlab
The reasoning is simple. MATLAB defaults to a 'jetblue' colormap when you use imshow(im). 

Typically you need to specify the colormap being used when you use imshow.

For this, add another command like:

$$colormap(gray(256));$$

to your current script.