@Arbalest-Laevatain
2018-05-26T11:47:23.000000Z
字数 1058
阅读 1120
MATLAB
离散数学
GVEdit
close all,clear,clc;
cm =[
0 10 0 18 0 0 0;
0 0 0 0 8 0 0;
25 0 0 0 0 9 0;
0 0 0 0 0 0 0;
0 0 13 0 0 0 0;
0 0 0 30 0 0 0;
0 0 0 0 15 12 0;
];
IDS={'A','B','C','D','E','F','G'};
bg=biograph(cm,IDS);
set(bg.nodes,'shape','circle','color',[1,1,1],'lineColor',[0,0,0]);
set(bg,'layoutType','radial');
bg.showWeights='on';
set(bg.nodes,'textColor',[0,0,0],'lineWidth',2,'fontsize',9);
set(bg,'arrowSize',12,'edgeFontSize',9);
get(bg.nodes,'position')
dolayout(bg);
bg.nodes(1).position=[100,200];
bg.nodes(2).position=[50,100];
bg.nodes(3).position=[100,100];
bg.nodes(4).position=[150,100];
bg.nodes(5).position=[0,0];
bg.nodes(6).position=[200,0];
bg.nodes(7).position=[100,0];
dolayout(bg,'pathsonly',true);
view(bg);
digraph G{
size = "5, 5";//图片大小
main[shape=box];/*形状*/
main->main;
parse->execute;
main->init[style = dotted];//虚线
main->cleanup;
edge[color = green]; // 连接线的颜色
execute->{make_string; printf}//连接两个
init->make_string;
main->printf[style=bold, label="100 times"];//线的 label
make_string[label = "make a\nstring"]// \n, 这个node的label,注意和上一行的区别
node[shape = box, style = filled, color = ".7.3 1.0"];//一个node的属性
execute->compare;
}