%% 第一种
figure;
A = rand(3,4,3);
A1 = A(:,:,1);
A2 = A(:,:,2);
A3 = A(:,:,3);
contourf(A1,A2,A3,30); colormap('jet');colorbar;
my_handle=colorbar;
my_handle.Label.String = 'depth/km';
my_handle.Label.FontSize = 15;
%% 第二种
figure;
A = rand(3,4,3);
A1 = A(:,:,1);
A2 = A(:,:,2);
A3 = A(:,:,3);
% my_handle.Label.String = 'Elevation (km)';
% my_handle.Label.FontSize = 15;
contourf(A1,A2,A3,30); colormap('jet');colorbar;
my_handle=colorbar;
my_handle.Title.String = 'depth/km';
my_handle.Title.FontSize = 12;
% t=get(my_handle,'YTickLabel');
% t=strcat(t,'km');
% set(my_handle,'YTickLabel',t);
第一种:
第二种:文章来源:https://www.toymoban.com/news/detail-765582.html
文章来源地址https://www.toymoban.com/news/detail-765582.html
到了这里,关于matlab设置colorbar标题的两种方式的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!