How to change the Marker size and the Marker symbol of some specific nodes

13 ビュー (過去 30 日間)
Romina
Romina 2019 年 10 月 29 日
コメント済み: Romina 2019 年 10 月 29 日
I need to change the size and symbol of nodes 801:1:1000, that is, i need Markersize = 5 and the Marker symbol, Marker = 's'.
And the nodes 1:1:800 smaller size, for example Markersize = 3 and Marker symbol, Marker = 'o'.
pesos_NE=rand(1000,1000); % Adjacency matrix of edge weights
G=graph(pesos_NE,'upper','omitselfloops');
f1=figure(1);
h=plot(G,'EdgeAlpha',0,'Marker','p','MarkerSize',3, 'Layout','force'); % 'EdgeLabel',G.Edges.Weight
h.EdgeCData=G.Edges.Weight;
title('Closeness Centrality (NE)')
CC_NE=centrality(G,'closeness','Cost',G.Edges.Weight); %Closeness Centrality
h.NodeCData=CC_NE;
colormap parula
colorbar

採用された回答

Sebastian Bomberg
Sebastian Bomberg 2019 年 10 月 29 日
You can use highlight with the appropriate Name/Value pairs:
highlight(h,801:1000,"Marker","s","MarkerSize",5)
  1 件のコメント
Romina
Romina 2019 年 10 月 29 日
Do you know how to add a legend for each of the two marker symbols?Legend.jpg

サインインしてコメントする。

その他の回答 (1 件)

Romina
Romina 2019 年 10 月 29 日
Thank you! it's exactly what i needed

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by