biograph node sizes

조회 수: 3 (최근 30일)
Amir Nahir
Amir Nahir 2011년 5월 2일
편집: Elizabeth Drybrugh 2018년 5월 24일
Hi, I've been trying to draw something using biograph. The nodes come out pretty big, and I tried controlling them with the Size attirbute, but: either the node size updates, and the edges seem "hanging", or I re-do 'dolayout' for the edges, and the node size resets. Here's an example of something I tried:
cm = [ 1 0 0 0 0 1 1 0; 1 1 1 0 0 0 0 0; 1 1 1 0 0 0 0 0; 0 0 1 1 1 0 0 0; 0 0 1 1 1 0 0 0; 1 0 0 0 1 1 0 0; 0 0 1 0 0 0 1 1; 0 0 1 0 0 0 1 1;];
bg = biograph(cm);
dolayout(bg)
bg.nodes(1).Position = [11 1];
bg.nodes(1).Shape = 'circle';
bg.nodes(1).Size = [2 2];
bg.nodes(2).Position = [8 6];
bg.nodes(2).Shape = 'circle';
bg.nodes(2).Size = [2 2];
bg.nodes(3).Position = [9 6];
bg.nodes(3).Shape = 'circle';
bg.nodes(3).Size = [2 2];
bg.nodes(4).Position = [17 6];
bg.nodes(4).Shape = 'circle';
bg.nodes(4).Size = [2 2];
bg.nodes(5).Position = [18 4];
bg.nodes(5).Shape = 'circle';
bg.nodes(5).Size = [2 2];
bg.nodes(6).Position = [16 2];
bg.nodes(6).Shape = 'circle';
bg.nodes(6).Size = [2 2];
bg.nodes(7).Position = [12 17];
bg.nodes(7).Shape = 'circle';
bg.nodes(7).Size = [2 2];
bg.nodes(8).Position = [13 17];
bg.nodes(8).Shape = 'circle';
bg.nodes(8).Size = [2 2];
dolayout(bg, 'Pathsonly', true);
dolayout(bg, 'Sizeonly', true);
view(bg)
Thanks!
Amir
  댓글 수: 1
Amir Nahir
Amir Nahir 2011년 5월 2일
of course, the command before last is illegal 'Sizeonly'... just desparate attempts...

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

답변 (1개)

Elizabeth Drybrugh
Elizabeth Drybrugh 2018년 2월 23일
편집: Elizabeth Drybrugh 2018년 5월 24일
Hey I hope you have fixed it by now if not then create variable
vg = view(bg)
Make sure the biograph GUI is kept open then you can modify properties E.g.
vg.nodes(1).size = [50 50]
I have attached an example with 12 nodes to let you see.

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by