Question regarding plotting a map consisting of different layers

5 次查看(过去 30 天)
Hello,
Using Matlab Mapping Toolbox, I want to plot a map (Baltic Sea Region, to be specific) which has three different layers in shapefile format, i.e. coastline, bathymetry, and land. However it doesn't work so far.
Here is the code:
% Load shapefile data
balticSea.coast = shaperead('ne_10m_coastline.shp');
balticSea.land = shaperead('ne_10m_land.shp');
balticSea.bathym = shaperead('ne_10m_bathymetry.shp')
% Create a figure
figure
mapshow(balticSea.coast)
mapshow(balticSea.land)
mapshow(balticSea.bathym)
Is there any ways to solve this?
Thank you.

回答(1 个)

Debadipto
Debadipto 2023-6-8
Hi Dipto,
Based on my understanding, you want to plot the three shapefiles on top of each other in a single map. You can utilise the ‘hold on’ syntax to get the desired output. Here is the updated code:
% Load shapefile data
balticSea.coast = shaperead('ne_10m_coastline.shp');
balticSea.land = shaperead('ne_10m_land.shp');
balticSea.bathym = shaperead('ne_10m_bathymetry.shp')
% Create a figure
figure
mapshow(balticSea.coast)
hold on
mapshow(balticSea.land)
mapshow(balticSea.bathym)
Regards,
Debadipto Biswas

标签

Community Treasure Hunt

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

Start Hunting!

Translated by