如何在MATLAB中为轮廓使用不同的颜色?

时间:2020-04-06 01:51:59

标签: matlab contour colormap contourf

Composite Figure我希望每个连续的轮廓都以不同的颜色绘制,或者希望将颜色图用于轮廓图。现在,所有轮廓都以白色绘制。我试图更改轮廓的颜色,但是我所能做的就是在'k'函数中使用contour()将它们全部涂成黑色。

P.S>我正在使用pcolor()在另一个hold on图形上绘制图形(它本身具有不同的颜色图)。

以下是绘图代码的一部分:

grid_x = 20:0.25:160;
grid_y = 30:-0.25:-10;

grid_x_sph = 20:2.5:160;
grid_y_sph =  30:-2.5:-10;

grid_lon = 20:1:160;
grid_lat = 30:-1:-10;

% grid is my struct containing other structs with data over a region 
    wave_data = grid.olr.avg(1).mjo; 
    sph_data = grid.avg.sph(1).mjo;
    u_data = grid.avg.u(1).mjo;
    v_data = grid.avg.v(1).mjo;



figure(13);
pcolor(grid_x,grid_y,wave_data'); shading interp; colormap(cmap3); hold on; colorbar;
[imxx,c]= contour(grid_x_sph,grid_y_sph,sph_data',8); 
quiver(grid_lon(1:3:end),grid_lat(1:3:end),u_data(1:3:end,1:3:end)',v_data(1:3:end,1:3:end)','k'); hold on;
xlim([20 160]);
ylim([-10 30]);
caxis([-7 5]);
load coast; hold on;
plot(long,lat,'k');
plot(long+360,lat,'k');
ylabel('LATITUDE');
title('MJO');

0 个答案:

没有答案