Effacer les filtres
Effacer les filtres

Question regarding plotting a map consisting of different layers

5 vues (au cours des 30 derniers jours)
Dipto
Dipto le 30 Mai 2023
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.

Réponses (1)

Debadipto
Debadipto le 8 Juin 2023
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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by