Spatial plot land part in gray color
I am plotting a spatial plot, I want land parts should be in gray or white colour. The code I am attaching is not working
figure;
imagesc(lon, lat, corr_coeff_weak’);
set(gca, ‘YDir’, ‘normal’);
colorbar;
colormap(redblue);
caxis([-1 1]);
xlabel(‘Longitude’);
ylabel(‘Latitude’);
title(‘Correlation for Weak SST Years’);
hold on;
load coastlines;
fill(wrapTo360(coastlon), coastlat, ‘w’, ‘EdgeColor’, ‘none’); % Fill land with white
plot(wrapTo360(coastlon), coastlat, ‘k.’, ‘MarkerSize’, 4);
axis xy;I am plotting a spatial plot, I want land parts should be in gray or white colour. The code I am attaching is not working
figure;
imagesc(lon, lat, corr_coeff_weak’);
set(gca, ‘YDir’, ‘normal’);
colorbar;
colormap(redblue);
caxis([-1 1]);
xlabel(‘Longitude’);
ylabel(‘Latitude’);
title(‘Correlation for Weak SST Years’);
hold on;
load coastlines;
fill(wrapTo360(coastlon), coastlat, ‘w’, ‘EdgeColor’, ‘none’); % Fill land with white
plot(wrapTo360(coastlon), coastlat, ‘k.’, ‘MarkerSize’, 4);
axis xy; I am plotting a spatial plot, I want land parts should be in gray or white colour. The code I am attaching is not working
figure;
imagesc(lon, lat, corr_coeff_weak’);
set(gca, ‘YDir’, ‘normal’);
colorbar;
colormap(redblue);
caxis([-1 1]);
xlabel(‘Longitude’);
ylabel(‘Latitude’);
title(‘Correlation for Weak SST Years’);
hold on;
load coastlines;
fill(wrapTo360(coastlon), coastlat, ‘w’, ‘EdgeColor’, ‘none’); % Fill land with white
plot(wrapTo360(coastlon), coastlat, ‘k.’, ‘MarkerSize’, 4);
axis xy; matrix, matrix manipulation, spatial maps, coastal boundary, image processing MATLAB Answers — New Questions