How to kill a colormap in a figure?

11 views (last 30 days)
hana
hana on 1 Jun 2012
I have a gui with a single axes. At different stages, different objects are drawn. The first object being drawn is a surf with colormap 1 and at a different instance, I'm hiding this first object : hidem (handles.obj1); to show a second set of objects (a set of surf objects) with their own colormap 2. My problem is when I'm getting rid of the 2nd object (by delete) and it's time to show the primary object, it's original colormap is disappearing!!
I have tried using "freezeColors", but it seems no matter what, one of the colormaps gets transferred to the other object. I guess it's because the first object never really disappears and it's always inside the axes, it's just not visible when I'm assigning a new colormap to the 2nd object. The clue is that I am showing these objects "not" simultaneously and I just want to go back to the first object with it's original colormap. I even tried specifying the original colormap1 when I showed my first object again, but no luck yet!
Any help is appreciated

Answers (1)

Image Analyst
Image Analyst on 1 Jun 2012
When you get rid of your second surf drawing, and display your first surf drawing again, you'll need to tell it to use your first surf colormap again.
Otherwise you might experiment around with the "cla" or "cla reset" command to get back to square one.

Categories

Find more on Colormaps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!