biograph node sizes

3 次查看(过去 30 天)
Amir Nahir
Amir Nahir 2011-5-2
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