필터 지우기
필터 지우기

How can I label each colorbar axis from a list, using subplot axis inside a for loop?

조회 수: 1 (최근 30일)
I want to label each colorbar axis using a list l inside the for loop. Is there any way I can make it? Thanks.
[ha, pos]= tight_subplot(1,5,[.09 .085],[.165 .02],[.1 .045]);
for jj=1:5
axes(ha(jj));
l={'m12','m23','m13','m32', 'm33'};
x=load(sprintf('m%d1.dat',jj));
x1=scatter(x(:,2),x(:,3),[],x(:,4),'filled');
hold on
set(gca,'Fontsize',34,'LineWidth',2.0,'TickDir','in')
set(gca,'XMinorTick','on','YMinorTick','on')
set(gca,'XMinorTick','on','YMinorTick','on','Box','on')
set(gca,'TickLength',[0.04, 0.01])
c = colorbar;
set(c,'FontSize',40)
c.Label.String =('$\rm{D_{a_{l{jj}}}}$');
c.Label.Interpreter = 'latex';
caxis([min(x(:,4)) 1]);
% caxis auto
xlabel('A_{{m}}');
end
ylabel('M_{{m}}')

채택된 답변

Walter Roberson
Walter Roberson 2023년 9월 13일
c.Label.String = "$\rm{D_{a_{" + l{jj} + "}}}$";

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by