biograph node sizes

3 Ansichten (letzte 30 Tage)
Amir Nahir
Amir Nahir am 2 Mai 2011
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 Kommentar
Amir Nahir
Amir Nahir am 2 Mai 2011
of course, the command before last is illegal 'Sizeonly'... just desparate attempts...

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Elizabeth Drybrugh
Elizabeth Drybrugh am 23 Feb. 2018
Bearbeitet: Elizabeth Drybrugh am 24 Mai 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.

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by