Message Boards Message Boards

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

[?] Place the vertex labels in a bipartite graph?

Posted 7 years ago
Attachments:
POSTED BY: Abhik
2 Replies

Abhik,

I am certain there is a more general way to do this but I relied on the fact that you used Strings for the Left-hand Nodes and Entities for the right hand nodes. Some of the other "Graph Experts" here, like @Szabolcs Horvát will likely have a more universal way to do this sort of thing. -- In fact you may want to use his iGraph package but I am not that familiar with it since I rarely do graphs.

Graph[graphData2, 
 VertexLabels -> {x_String -> Placed["Name", Before], 
   x_Entity -> Placed["Name", After]}, 
 GraphLayout -> "BipartiteEmbedding", ImageSize -> Large]

to get

enter image description here

Regards,

Neil

POSTED BY: Neil Singer

As for your edges:

Graph[graphData2, 
 VertexLabels -> {x_String -> Placed["Name", Before], 
   x_Entity -> Placed["Name", After]}, 
 EdgeStyle -> {DirectedEdge["United States", _] -> {Thick, Red}}, 
 GraphLayout -> "BipartiteEmbedding", ImageSize -> Large]
POSTED BY: Neil Singer
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