I found this code on the undocumented matlab blog. The slightly modified version is given below. However I am having trouble in adding annotations to the 2nd tab. I am unable to do that as of now.
hTabGroup = uitabgroup; drawnow; tab1 = uitab(hTabGroup, 'title','Panel 1'); a = axes('parent', tab1); surf(peaks); tab2 = uitab(hTabGroup, 'title','Panel 2'); b = axes('parent', tab2); t=annotation('textbox'); set(t,'parent',gca); surf(peaks); tab3 = uitab(hTabGroup, 'title','Panel 3'); c = axes('parent', tab3); surf(peaks);
I also tried to change the background colour to white using:
set(gcf,'color','w');
but this also does not seem to work. I am surely missing something but unable to figure out how to solve the problem. Any help would be appreciated. Thanks
Best Answer