%% 第一种 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);
第一种:
第二种: