Colorbar cannot be added to another colorbar.
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
I have a GUI with several contour maps and colorbars related to these contour maps. I would like to choose and change the data for the contour map via popup in the GUI, which works well with the contour maps. If I want to change the colorbar I get the message: "Colorbar cannot be added to another colorbar."
Code:('contents' is the parameter chosen in the popup menu)
   switch contents
          case 1
          contourf(handles.axes1,handles.qx,handles.qy,handles.dataset1);
          colorbar(handles.axes2);
          case 2     
          contourf(handles.axes1,handles.qx,handles.qy,handles.dataset2);
          colorbar(handles.axes2);
      end
I tried "cla" or "colorbar('delete')" at the beginning of the cases, but no success. How can I replace the colorbar?
0 Kommentare
Antworten (1)
  Image Analyst
      
      
 am 10 Jan. 2013
        Maybe try the delete option before you call it:
colorbar('delete');
colorbar(handles.axes2);
1 Kommentar
Siehe auch
Kategorien
				Mehr zu Colorbar finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

