M_map file with contourf
6 views (last 30 days)
Jonathan Demmer on 31 Aug 2022
I am using M_map to create a figure of Indonesian waters. As you can notice on the figure below (too heavy to upload as matlab fig...), the waters with a depth below 1000 m are in white. I would like to have the water below 1000 in darblue then a decrease of colour for shalower water as presented on hte legend. I think it has something to do with contourf but I tried different code and i am stuck... Can someone help me please?
% add path to matlab functions:
% Coordinates of all Indonesia
% 'lon',[90 146.64],'lat',[-12 14.15]);
m_proj('lambert','long',[90 146.64],'lat',[-12 14.15]);
m_gshhs_f('patch',[.7 .7 .7],'edgecolor','none');
Bjorn Gustavsson on 31 Aug 2022
You might get away by modifying the colormap with the brighten function, perhaps something like:
This should change the colours giving a more blue (if I got it right) appearance than the default m_colmap('blues') give. You could also directly modify that colourmap as you see fit:
mblues = m_colmap('blues');
mblues = mblues.^4; % any modification you see fit that leaves the values between 0 and 1...