필터 지우기
필터 지우기

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 CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by