我有以下代码,显示名为zero
的图像。
我想覆盖相同尺寸的遮罩图片(仅0
和1
值),以便0
值透明(然后我们可以看到zero
图片)和1
值以黑色显示。
我该怎么办?
hFig = figure(1);
set(hFig, 'Position', [11 11 27 7.5]);
set( gca, 'Units', 'normalized', 'Position', [0.05 0.05 0.93 1.2] );
set(0,'defaultFigureUnits','centimeters');
m_proj('equidistant cylindrical','longitudes',[-15 21],'latitudes',[11.5 18]);
m_gridF('ytick',4,'tickdir','out','ticklen',0.005,'linestyle','none');
hold; Plat=18-[0:13]*0.5;
Plon=-15+[0:72]*0.5;
[Plg,Plt]=meshgrid(Plon,Plat);
m_pcolor(Plg,Plt,zero);shading flat;
hold on;
polarmap(flipud(polarmap),0)
M=m_shaperead('clip');
for k=1:length(M.ncst),
m_line(M.ncst{k}(:,1),M.ncst{k}(:,2),'color','k');
end
hold;
h=colorbar('SouthOutside');
set(h, 'Position', [0.13 .1 .78 .05]);
set(get(h,'title'),'string','test','fontsize',14)
hold;