how to make a patch on geoplot?

조회 수: 20 (최근 30일)
Sierra
Sierra 2022년 6월 28일
댓글: Chunru 2022년 6월 28일
I made a patch on plot.
i wanted to make a same patch on a geoplot. but it didn't work.
It would be good if you explain with 4 coordinates. do not mind 'z' value I will make a patch on 2d geoplot.
The coordinates is
x = [126.509 126.508 126.511 126.512]
y = [37.403 37.4063 37.4048 37.4081]
Thanks.

채택된 답변

Chunru
Chunru 2022년 6월 28일
You data is not in correct order. The axis scale is also not proportional. Try geoplot if you have mapping toolbox.
x = [126.509 126.508 126.511 126.512];
y = [37.403 37.4048 37.4081 37.4063]; % The original data order is incorrect
% geoplot
figure
geoplot(y([1:end 1]), x([1:end 1]))
geobasemap streets
% normal plot
figure
plot(x([1:end 1]), y([1:end 1]))
axis equal
  댓글 수: 2
Sierra
Sierra 2022년 6월 28일
How can i merge all rectangular if i make several rectangular on geoplot?
Chunru
Chunru 2022년 6월 28일
Just "hold on" and plot all rectangles.

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

추가 답변 (1개)

KSSV
KSSV 2022년 6월 28일
편집: KSSV 2022년 6월 28일
x = [126.509 126.508 126.511 126.512] ;
y = [37.403 37.4063 37.4048 37.4081] ;
patch(x,y,'r')
In case, you looking for:
[val,idx] = sort(x) ;
patch(x(idx),y(idx),'r')
  댓글 수: 3
KSSV
KSSV 2022년 6월 28일
Won't hold on and patch work?
Sierra
Sierra 2022년 6월 28일
Patch does not work well on geoplot. Thanks

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

카테고리

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