How can I change the colormap for each tab in a tabbed figure?
이전 댓글 표시
I am trying to create a tabbed figure where each of the two tabs has a different viewshed plotted on terrain using the mapping toolbox. I am able to create the tabbed figure, but I am unable to figure out how to use a different colormap on each tab. With the code below both of the tabs are using the colormap from the first tab (summer(2)). I've also been able to get both tabs to take on the colormap from the second tab (flipud(summer(2)) by not setting h1=axesm for the first tab and not setting h2=axesm for the second tab. Is there a way to set a different colormap for each tab of the figure?
figure(1);
tg=uitabgroup();
thistab=uitab(tg,'title','Terrain');
axes('Parent',thistab)
h1=axesm('globe','geoid',1.7365E+06);
meshm(viewshed,refmat,size(Z), Z);
axis tight
camposm(0,90,1e4)
camupm(90,0)
colormap(h1, summer(2))
shading interp
camlight
title('Terrain');
thistab=uitab(tg,'title','Visibility');
axes('Parent',thistab)
h2=axesm('globe','geoid',1.7365E+06);
hold on;
meshm(viewshed2,refmat,size(Z),Z);
axis tight
camposm(0,90,1e4)
camupm(90,0)
colormap(h2, flipud(summer(2)))
shading interp
camlight
title('Visibility 1');
Additional info: I'm running this code from app designer. Since mapping toolbox axes aren't well supported for UIAxes I'm trying to use tabbed figures to organize all the mapping toolbox based plots generated by my app.
Thank you in advance for the help!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!