フィルターのクリア

How can i plot a number of cities onto a DEM?

4 ビュー (過去 30 日間)
Epiphanie IMANIMFASHE
Epiphanie IMANIMFASHE 2021 年 6 月 7 日
回答済み: Balavignesh 2023 年 10 月 11 日
I have a question in matlab, I want to plot the Cities in a DEM . So to plot the cities I am using geoshow, to show the DEM i am using mapshow,
None of these functions can display both cities and DEM alone.
Also when I want to superimpose them by using 'hold on' function, in order that all of them can be visible , so it is not working. I need some help if you have an idea about it please.

回答 (1 件)

Balavignesh
Balavignesh 2023 年 10 月 11 日
Hi Epiphanie,
As per my understanding, you would like to plot the citites onto a 'Digital Elevation Model (DEM)'.
I assume you would have the dataset of the cities and the elevation matrix. I would suggest you to use the 'imagesc' function to display the elevation data, 'geoshow' function to plot the cities, and 'hold' function to superimpose the cities onto DEM.
The following example code may help you understand this:
% This is an example dataset.
Z = [100 200 300;400 500 600;700 800 900];
% Display the elevation data
imagesc(Z);
colorbar;
% Hold to superimpose the cities
hold on;
% Sample city locations
cities = [0.5 0.8;1.2 1.5;2.0 0.7];
% Display the city locations onto DEM
geoshow(cities(:, 2), cities(:, 1), 'Marker','o', 'MarkerSize', 10, 'MarkerFaceColor', 'red');
% Customize the plot as desired
xlabel('Longitude');
ylabel('Latitude');
title('Cities on Elevation Model');
% Release the hold
hold off;
Kindly have a look at the below documentation links to have more information on:
Hope that helps!
Balavignesh

カテゴリ

Help Center および File ExchangeGeographic Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by