我想在任何节点上放置标签, 我使用
绘制带边的节点gplot(adjacencyM,[A(1:2:end)',A(2:2:end)'],'-*');
结果是
如何在节点上放置标签?比如1,2,3,4,5 ......
A=[52.4804497434472 27.6195191737248 4.21212076867730 30.4259790113270 48.7710166342266 39.0235130272618 77.6293705126495 27.8870044967533 8.53744606710097 96.9598745936163 17.0082513400534 1.22018736621158 45.2910471948658 19.6246954290650 32.3671095309084 46.6923831457201 52.0721582460992 13.2199644010638 9.61840162265927 40.9950628287157
]
答案 0 :(得分:1)
您可以使用Matlab's text
command
例如:
text( A(1,1), A(1,2), 'Label first node');
或循环:
for li=1:2:numel(A)
text( A(li), A(li+1), sprintf('<--%d', li) );
end