在彩色地图白色中绘制海冰浓度
plot sea ice concentration in color map white
我有一个带有纬度、经度和 ice_conc 的 nc 文件。我希望将海冰浓度绘制在方形网格(脚本所做的)中,颜色为白色而不是黄色,并让开阔的海洋为蓝色。这是我拥有的:
silo=ncread('ice_conc_201707031200_v2.nc','lon');
sila=ncread('ice_conc_201707031200_v2.nc','lat');
si=ncread('ice_conc_201707031200_v2.nc','ice_conc');
F = scatteredInterpolant(silo',sila',si');
[lox,lay] = meshgrid(-80:0.05:80,-70:0.05:-20);
sii = F(lox,lay);
sii(isnan(sii))=0;
set(groot,'defaultAxesTickLabelInterpreter','latex');
set(groot,'defaulttextinterpreter','latex');
set(groot,'defaultLegendInterpreter','latex');
close all
ax1 = axes;
contourf(ax1,lox,lay,sii/100,'LineColor','none'); % do I plot colormap in white for 100% seaice down
to blue for 0% sea ice??
grid on, axis equal, xlim([10 50]), ylim([-70 -30])
enter image description here
一种方法是创建您自己的颜色图。下面是一个可能的例子:
cmap = colormap(); % your current colormap
n = size(cmap, 1)/2; % change only the second half of the colormap
col = cmap(n, :); % color at the halfway point
for i = 1:3
% For example linearly interpolate the color between the one at the halfway point and white
cmap(n:end, i) = linspace(col(i), 1, length(cmap(n:end, i)));
end
contourf(...) % your plot
colormap(cmap) % apply the colormap
我有一个带有纬度、经度和 ice_conc 的 nc 文件。我希望将海冰浓度绘制在方形网格(脚本所做的)中,颜色为白色而不是黄色,并让开阔的海洋为蓝色。这是我拥有的:
silo=ncread('ice_conc_201707031200_v2.nc','lon');
sila=ncread('ice_conc_201707031200_v2.nc','lat');
si=ncread('ice_conc_201707031200_v2.nc','ice_conc');
F = scatteredInterpolant(silo',sila',si');
[lox,lay] = meshgrid(-80:0.05:80,-70:0.05:-20);
sii = F(lox,lay);
sii(isnan(sii))=0;
set(groot,'defaultAxesTickLabelInterpreter','latex');
set(groot,'defaulttextinterpreter','latex');
set(groot,'defaultLegendInterpreter','latex');
close all
ax1 = axes;
contourf(ax1,lox,lay,sii/100,'LineColor','none'); % do I plot colormap in white for 100% seaice down
to blue for 0% sea ice??
grid on, axis equal, xlim([10 50]), ylim([-70 -30])
enter image description here
一种方法是创建您自己的颜色图。下面是一个可能的例子:
cmap = colormap(); % your current colormap
n = size(cmap, 1)/2; % change only the second half of the colormap
col = cmap(n, :); % color at the halfway point
for i = 1:3
% For example linearly interpolate the color between the one at the halfway point and white
cmap(n:end, i) = linspace(col(i), 1, length(cmap(n:end, i)));
end
contourf(...) % your plot
colormap(cmap) % apply the colormap