How to highlight the vertex (vertices) of a voronoi diagram?

6 ビュー (過去 30 日間)
Aida Jones
Aida Jones 2018 年 6 月 5 日
編集済み: Rishabh Rathore 2018 年 6 月 5 日
This is the program i have written. How do i highlight (bold) the vertex?
x=[1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 5 5 6 6 7 7 7 8 8 8 8 9 9];
y=[1 3 5 7 8 9 10 2 3 4 6 9 1 2 3 5 7 8 10 1 2 4 5 7 8 9 10 1 2 5 8 2 4 8 1 4 6 8 5 7];
axis([0 10 0 10]);
hold on;
scatter(x, y, [], 'filled');
[vx,vy] = voronoi(x,y)
plot(vx,vy,'red')

採用された回答

Rishabh Rathore
Rishabh Rathore 2018 年 6 月 5 日
編集済み: Rishabh Rathore 2018 年 6 月 5 日
you can use scatter to plot/highlight the vertices of the Voronoi diagram by adding the lines of code below at the end of your code.
scatter(vx(1,:),vy(1,:),'black');
scatter(vx(2,:),vy(2,:),'black');

その他の回答 (1 件)

JAYANTH BHIMAVARAPU
JAYANTH BHIMAVARAPU 2018 年 6 月 5 日
You can find the vertices of voronoi diagram using this:
from = [vx(1,:);vy(1,:)];
to = [vx(2,:);vy(2,:)];
Then using "hold on" command you can plot these points on the top of the previous plot with different color or with different linestyle.

カテゴリ

Help Center および File ExchangeVoronoi Diagram についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by