How to overlap several maps?
Show older comments
Hi all,
I wrote two codes (code 1 and code 2) below to produce the pictures attach within htis question. I would like to add on th figure showing the vessel density (vessel density.png file; code 1), the limit of the coastal area of the United Kingdom (and associated islands) and Ireland using M_map (also attached here: UK.jpg; code 2). does someone how can I write one code to have both on it? Also, if someone knows how to fill the land (inside the coastal limit) in white to make it look better that would be also great.
Regards
%% Code 1
% assign the path to your working directory:
cd ('E:\Data_emodnet_fisheries\Vessel_density\');
load Average.mat % Matrice representing the positon of boat in the sea
imshow(Average,Colormap=turbo);
limits = [0,3];
c = colorbar;
set(gca,'clim',limits([1,end]));
c.Label.String = 'Vessel density (h/m2/month)';
saveas(gcf,'Vessel_density.png')
%% Code 2
% assign the path to your working directory:
cd ('E:\publi\Waiting-room\Matt_paper_hydrogen\figure_Matt\new\gshhg-bin-2.3.7(1)\');
% add path to TelemacTolls functions (i.e. to read in telemac files into MATLAB):
addpath ('C:\Matlab_download\m_map1.4\m_map\');
workingFolder = tempdir;
latlim = [48 63];
lonlim = [-12 3];
S = gshhs('gshhs_h.b', latlim, lonlim);
levels = [S.Level];
L1 = S(levels == 1);
figure
plot ([L1.Lon],[L1.Lat], '-b');
xlim([-11 3]);
ylim([49 61]);
Accepted Answer
More Answers (0)
Categories
Find more on Blue in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

