blank spots in plot when using fill() ?

I want to plot a map and color districts depending on a parameter. I have the coordinates of the districts but often they aren't in the right order, which leads to blank spots in my plot (see attached files). There is not enough information to order the coordinates right. So is there an alternative for fill() where I can identify the contour of the district and color it? Working with boundaries() is too inaccurate, unfortunately.

답변 (1개)

KSSV
KSSV 2017년 8월 26일

0 개 추천

You can order them based on distance criteria....read about knnsearch. This gives nearest neighbor to the given point from a data. Run a loop and get the nearest neighbor for each and save them. Using this you can order those points so that you can use fill.

댓글 수: 1

Benedikt Hümmer
Benedikt Hümmer 2017년 8월 29일
The problem here is that the nearest point often isn't the "right" point because the shapes of the districts can be very twisty and the distance between 2 coordinates can differ.

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

카테고리

태그

질문:

2017년 8월 26일

댓글:

2017년 8월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by