我有这个漂亮的代码,它显示了两个等高线图。我想知道是否可以以连续方式而不是离散方式显示颜色栏中的所有颜色?这是下面的代码,谢谢:
[r,x] = meshgrid(1:0.01:50,-1:0.01:5);
am=(1/4)*(r+(1./r)).*((1-x.^2).^-0.5);
num=2+( x.*(r+(1./r)) );
dem=(r-(1./r)).*((1-x.^2).^0.5);
G=am.*EA(num./dem);
test=G;
test(G<0)=nan;
test(x==1)=test(x==0);
figure
contourf(log10(r),x,test,'LevelList', [-inf,0,1,2,3,4,5,inf]);
h=colorbar;
set(get(h,'ylabel'),'string',' \gamma P_pL','FontSize',18)
xlabel('$log_{10}(r)$','Interpreter','latex','FontSize',18)
ylabel('$D/2\sqrt{M}$','Interpreter','latex','FontSize',18)
set(gca,'fontsize',18)
sigpm=1- (2./(r+(1./r)));
DEm=1+((1-sigpm).*x);
sig0=sigpm./DEm;
figure
contourf(sigpm*100,sig0*100,test,'LevelList', [-inf,0,1,2,3,4,5,inf]);
h=colorbar;
set(get(h,'ylabel'),'string',' \gamma P_pL','FontSize',18)
xlabel('$\sigma_\pm$','Interpreter','latex','FontSize',18)
ylabel('$\sigma_0$','Interpreter','latex','FontSize',18)
set(gca,'fontsize',18)
xlim([0 20])