A note on my submission above - I realized setting CLimMode back to auto only worked because I had already frozen the colorbar using cbfreeze . If it is not already frozen, when CLimMod is reset to auto the colorbar loses its limits (undoing the whole purpose of line 159)
This function was just what I needed for a contouring GUI I have where the user can contour selectable datasets on a map. However, I found that the contour levels got stuck to that of the first contour even though it had been deleted.
I found that at line 159 where the CLim data for the parent is restored this set the CLimMode to manual vs. auto. The CLim data held the data limits for the contour. Successive contours used these limits even though the data was not in this range.
Adding a line to reset the CLimMode back to auto solves this.