- 积分
- 1448
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-9-30
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
matlab画两种colormap的拼接
clear;clc;close all;
%% 微信公众号:海洋与大气公众号
%% 作者:mapm
%读入地形数据
data_topo='ETOPO2v2g_f4.nc';
x=ncread(data_topo,'x');%[-180 180]
y=ncread(data_topo,'y');%[-90 90]
z=ncread(data_topo,'z');%[-10722 8046]
%将x[-180 180]转换为[0 360]
[row,~]=find(x<=0);
x(row,1)=x(row,1)+360;
x = circshift(x,[length(row)-1 0]);
z= circshift(z,[length(row)-1 0]);
%% % colormap(m_colmap('diverging',30))
figure
set(gcf, 'Color', [1 1 1])%,'position',[910,340,1000,650])
m_proj('miller','lon',[105 114],'lat',[15 22]);hold on
hold on
inter1=2;inter2=2;
m_pcolor(x(1:inter1:end),y(1:inter2:end),z(1:inter1:end,1:inter2:end)')
shading interp
colorbar
% 调用颜色
colormap([ m_colmap('blues',80); m_colmap('gland',48)]);
m_grid('ytick',[15:1:22],'xtick',[100:5:120])
m_coast('color','g','LineWidth',1);
caxis([-5000 3000]);
title('matlab画两种colormap的拼接','fontsize',15)
export_fig(['colormore_',num2str(1),'大洋中脊.png'],'-r300')
%% % colormap(m_colmap('diverging',30))
figure
set(gcf, 'Color', [1 1 1])%,'position',[910,340,1000,650])
m_proj('miller','lon',[105 114],'lat',[15 22]);hold on
hold on
inter1=2;inter2=2;
m_pcolor(x(1:inter1:end),y(1:inter2:end),z(1:inter1:end,1:inter2:end)')
shading interp
colorbar
% 调用颜色
colormap([ m_colmap('blues',80); m_colmap('gland',48)]);
m_grid('ytick',[15:1:22],'xtick',[100:5:120])
caxis([-5000 3000]);
title('matlab画两种colormap的拼接','fontsize',15)
export_fig(['colormore_',num2str(2),'大洋中脊.png'],'-r300')
%% % colormap(m_colmap('diverging',30))
figure
set(gcf, 'Color', [1 1 1])%,'position',[910,340,1000,650])
m_proj('miller','lon',[105 114],'lat',[15 22]);hold on
hold on
inter1=2;inter2=2;
m_pcolor(x(1:inter1:end),y(1:inter2:end),z(1:inter1:end,1:inter2:end)')
shading interp
colorbar
cmap1=colormore_51(80);
cmap2=colormore_52(48);
% 调用颜色
colormap([ flip(cmap1); cmap2]);
m_grid('ytick',[15:1:22],'xtick',[100:5:120])
caxis([-5000 3000]);
title('matlab画两种colormap的拼接','fontsize',15)
export_fig(['colormore_',num2str(3),'大洋中脊.png'],'-r300')
%% % colormap(m_colmap('diverging',30))
figure
set(gcf, 'Color', [1 1 1])%,'position',[910,340,1000,650])
m_proj('miller','lon',[105 114],'lat',[15 22]);hold on
hold on
inter1=2;inter2=2;
m_pcolor(x(1:inter1:end),y(1:inter2:end),z(1:inter1:end,1:inter2:end)')
shading interp
colorbar
cmap1=colormore_49(80);
cmap2=colormore_50(48);
% 调用颜色
colormap([ flip(cmap1); cmap2]);
m_grid('ytick',[15:1:22],'xtick',[100:5:120])
caxis([-5000 3000]);
title('matlab画两种colormap的拼接','fontsize',15)
export_fig(['colormore_',num2str(4),'大洋中脊.png'],'-r300')
%% % colormap(m_colmap('diverging',30))
figure
set(gcf, 'Color', [1 1 1])%,'position',[910,340,1000,650])
m_proj('miller','lon',[105 114],'lat',[15 22]);hold on
hold on
inter1=2;inter2=2;
m_pcolor(x(1:inter1:end),y(1:inter2:end),z(1:inter1:end,1:inter2:end)')
shading interp
colorbar
cmap1=colormore_45(80);
cmap2=colormore_46(48);
% 调用颜色
colormap([ flip(cmap1); cmap2]);
m_grid('ytick',[15:1:22],'xtick',[100:5:120])
caxis([-5000 3000]);
title('matlab画两种colormap的拼接','fontsize',15)
export_fig(['colormore_',num2str(5),'大洋中脊.png'],'-r300')
%% % colormap(m_colmap('diverging',30))
figure
set(gcf, 'Color', [1 1 1])%,'position',[910,340,1000,650])
m_proj('miller','lon',[105 114],'lat',[15 22]);hold on
hold on
inter1=2;inter2=2;
m_pcolor(x(1:inter1:end),y(1:inter2:end),z(1:inter1:end,1:inter2:end)')
shading interp
colorbar
cmap1=colormore_35(80);
cmap2=colormore_9(48);
% 调用颜色
colormap([ flip(cmap1); cmap2]);
m_grid('ytick',[15:1:22],'xtick',[100:5:120])
caxis([-5000 3000]);
title('matlab画两种colormap的拼接','fontsize',15)
export_fig(['colormore_',num2str(6),'大洋中脊.png'],'-r300')
%% % colormap(m_colmap('diverging',30))
figure
set(gcf, 'Color', [1 1 1])%,'position',[910,340,1000,650])
m_proj('miller','lon',[105 114],'lat',[15 22]);hold on
hold on
inter1=2;inter2=2;
m_pcolor(x(1:inter1:end),y(1:inter2:end),z(1:inter1:end,1:inter2:end)')
shading interp
colorbar
cmap1=colormore_5(80);
cmap2=colormore_6(48);
% 调用颜色
colormap([ flip(cmap1); cmap2]);
m_grid('ytick',[15:1:22],'xtick',[100:5:120])
caxis([-5000 3000]);
title('matlab画两种colormap的拼接','fontsize',15)
export_fig(['colormore_',num2str(7),'大洋中脊.png'],'-r300')
|
|