biograph node sizes
1 view (last 30 days)
Show older comments
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
Answers (1)
Elizabeth Drybrugh
on 23 Feb 2018
Edited: Elizabeth Drybrugh
on 24 May 2018
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.
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!