By default colormap() sets the figure colormap, not the axes colormap. You are moving the axes to a different figure that has a different (default) figure colormap active so the axes takes on that other colormap.
There must be a flag somewhere so the system knows whether to override the axes colormap with the figure colormap. I cannot find this flag (in the axes properties).
My problem is intermittent, so I cannot reduce it to simple code for now. The long description is to do with saving subplots from my GUI. I have various panels/tabs with subplots that I want to save to individual file. The way I do that is create a new figure, temporarily assign the parent of the Panel to the new figure, then save the figure, after which I assign the Panel back to its original parent.
One thing for sure, I've set the colormap of the axes. Initially it all works fine. I collect data, then save the plots, and the colormaps of the saved figures are correct. But I suspect at some point in using my GUI, the flag that marks the axis as having its own colormap is reset by an internal routine, causing it to switch colormap map when I assign it to a new figure. Once the colormap switch occured, then subsequent saves of my plotted data all have the default parula colormap.
Restarting my GUI resets the colormap back to what I want.
I'm using GUI Layout Toolbox, which may be contributing to this problem. And running my GUI on R2016a works fine. R2018a is switching my colormaps.