Message Boards Message Boards

0
|
1364 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How can we get vertex names for "NetworkGraph" ExampleData?

Posted 11 months ago

How can I label each node in, say,

CommunityGraphPlot@ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]

From

FindGraphCommunities@ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]

I know that there dolphin names are in there, but I cannot get to them, not even with "VertexProperty". Could someone kindly help pls? Many thanks in advance.

POSTED BY: Poomjai Nacaskul
3 Replies
Posted 11 months ago

Try

g = ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
VertexList@g
EdgeList@g
POSTED BY: Rohit Namjoshi
Posted 11 months ago

I just re-read your question and realized that I misunderstood it. I think you want

g = ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]    
Graph[g, VertexLabels -> "Name"]
POSTED BY: Rohit Namjoshi

So simple and so nice! Sorry for taking up your time for such a simple issue! Thank you very much.

POSTED BY: Poomjai Nacaskul
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract