Spatial plot land part in gray color

5 visualizaciones (últimos 30 días)
Joydeb Saha
Joydeb Saha el 21 de En. de 2025
Comentada: Austin M. Weber el 21 de En. de 2025
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;
  2 comentarios
Mathieu NOE
Mathieu NOE el 21 de En. de 2025
hello
can you provide corr_coeff_weak data ?
Austin M. Weber
Austin M. Weber el 21 de En. de 2025
Have you tried plotting your data using a map axes instead? With the axesm function you can specify to plot longitudes from 0 to 360 instead of -180 to +180. For example:
load coastlines
figure;
axesm('Robinson','MapLonLimit',[0 360])
fillm(coastlat,coastlon,'FaceColor','#505050','EdgeColor','none')
framem
gridm
box off
set(gca,'YColor','none','XColor','none')

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Mapping Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by