필터 지우기
필터 지우기

plot earthquake locations data on a geotiff file

조회 수: 6 (최근 30일)
Anitha Limann
Anitha Limann 2023년 10월 17일
댓글: Dyuman Joshi 2023년 10월 20일
Hello,
I want to plot locations of earthquakes on a base map. I do have a geotiff file that i can use to create a base map but using following code i was unable to map the points on the base map. Please let me know the error in this code.
Data = load('Area_1.txt','-ascii'); % earthquake locations
lon = Data(:,1); lon = 360+lon; % longitude
lat = Data(:,2); % latitude
nv1 = importdata("volcanic.xyz"); % spreading ridge
lon1 = nv1(:,1); % longitude
lat1 = nv1(:,2); % latitude
figure(1); clf; axis equal; hold on;
basemap = readgeoraster("exportImage.tiff");
imshow(basemap);
plot(lon1, lat1,'.'); % spreading ridge
scatter(lon, lat, 15, c,'filled','o','LineWidth', 1, 'MarkerFaceAlpha', 0.9); % earthquake locations
ylabel('latitude (deg)'); xlabel('longitude (deg)');
title(['CMT Depth distribution ', Name])
xlim([min(lon) max(lon)]); ylim([min(lat) max(lat)])

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 10월 17일
You should be using geoplot, geoscatter and mapshow/geoshow instead of plot(), scatter() and imshow().
If, even after making the above mentioned changes, the code is not working or the output is not as desired, please attach the data files you are working with.
  댓글 수: 8
Anitha Limann
Anitha Limann 2023년 10월 20일
Thank you so much for your kind support. You have been extremely helpful to me. Thanks again.
Dyuman Joshi
Dyuman Joshi 2023년 10월 20일
You are welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by