scatter를 contour처럼 colorbar에 연동해서 적용
clc; clear; close all;
%% input
x=.5:9.5;
y=x;
z=randi([0 10],1,length(x));
%% figure
figure('Visible','on')
% plot
scatter(x,y,75,z,'filled','MarkerEdgeColor','r')
% colorbar
c = colorbar;
c.Label.String = 'depth (m)';
clim([1 10])
colormap gray
% legend
legend('depth','Location','southeast')
% deco
xlim([0 10])
ylim([0 10])
xticks(0:1:10)
yticks(0:1:10)
xlabel(['longitude',char(176)])
ylabel(['latitude',char(176)])
title('coordinate\_depth')
% set
set(gca,'fontname','Arial','fontweight','bold','fontsize',15,'Box','on','linewidth',2,'Layer','top');
set(gcf,'color','w','Units','Normalized','OuterPosition',[0.2 0.2 .45 .65]);
|
'matlab' 카테고리의 다른 글
[ matlab] strcut 구조 변수 저장 방법 (0) | 2023.03.31 |
---|---|
[copernicus] 데이터 처리 (0) | 2023.03.05 |
[matlab] 정점 contour interpolation 변환 (2) | 2023.02.21 |
행렬에서 NaN 값 인덱스/ 제거 (0) | 2023.02.20 |
상황별 자주 사용하는 구문 (0) | 2023.02.17 |