How can I set Longiture & Latitude of the map in this 3D model? ( I want [0 - 45 E] [30 - 80 N] ) ..not all the map...

조회 수: 1 (최근 30일)
3DATMO.png
[lon,lat,z] = meshgrid(-180:3:180,-80:2:80,0:100:2000);
T = 30 - .1*abs(lat) - .01*z + sind(lon);
figure
pcolor3(lon,lat,z,T,'direct','alphalim','auto')
% format:
xlabel('longitude')
ylabel('latitude')
zlabel('elevation (m)')
axis tight
set(gca,'xtick',[-180 -90 0 90 180],...
'ytick',[-45 0 45])
c = load('coast.mat');
plot(c.long,c.lat)
??

채택된 답변

Cam Salzberger
Cam Salzberger 2018년 11월 21일
Hello Yakov,
Since you are using the standard graphics to display the map, you should be able to simply use axis, or xlim and ylim.
axis([0 45 30 80])
or
xlim([0 45])
ylim([30 80])
However, if you have the Mapping Toolbox, I'd suggest taking a look at using mapping axes to help with automatic handling of latitude and longitude, as well as more flexible and accurate projections.
You may also consider trying out a geographic density plot (only needs base MATLAB). It will alleviate the need for you to plot the coastline data manually, and can provide more detail to the maps, though I'm not sure if the display will quite fit your use-case.
-Cam

추가 답변 (0개)

카테고리

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