I'm trying to shade profiles of different measurements over depths and the colors look limited
3 次查看(过去 30 天)
显示 更早的评论
I am using contourf to plot data overdepth. The first panel looks fine, but in the second it looks like only four colors are being used for some reason. I cannot figure out why this is the case. The individual data are different so it isn't just the same number repeated. Can anyone help me explain this? I have copied my script (below) and attached the relevant data.
f3=figure(3)
ax(1) = subplot(2,1,1)
hold on
contourf(MX,mabs,fixPCO2(2:8,:),'LineStyle','none')
contour(MX,mabs,fixPCO2(2:8,:),[1000 1000],'w','linewidth',1)
hold off
shading('interp');
ylabel('mab','fontsize',16);
caxis([350 1000]);
b=colorbar; colormap(ax(2),jet)
title(b,'pCO2','fontsize',16);
set(gca,'fontsize',16);
x = datenum('July-30-2018'):1:datenum('Aug-13-2018');
set(gca, 'XTick', x);
datetick('x','mm/dd','keepticks')
%set(gca,'XTickLabel','');
ax(2) = subplot(2,1,2)
hold on
contourf(MX,mabs,fixOMEGA(2:8,:),'LineStyle','none')
contour(MX,mabs,fixOMEGA(2:8,:),[1 1],'w','linewidth',1)
hold off
shading('interp');
ylabel('mab','fontsize',16);
caxis([.76 2.2]);
colormap(ax(3),flipud(jet))
set(gca,'fontsize',16);
c=colorbar();
title(c,'\Omega_A_r','fontsize',16);
x = datenum('July-30-2018'):1:datenum('Aug-13-2018');
set(gca, 'XTick', x);
datetick('x','mm/dd','keepticks')
linkaxes(ax,'x')
1 个评论
Aghamarsh Varanasi
2020-3-26
Can you give more details on the variables used in this command
contourf(MX,mabs,fixPCO2(2:8,:),'LineStyle','none');
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!