2
$\begingroup$

I have a directed graph consisting of 1616 vertices and an edge count = 3315. I'm trying to plot this by the code...

Clear["Global`*"]
SetSystemOptions[
  "GraphOptions" -> {"CacheResults" -> True, 
    "EdgeCountThreshold" -> 20000, "RenderingOrder" -> "VertexFirst", 
    "VertexCountThreshold" -> 2000}];

x = N6037; y = N6065 | N6071 | N6073; g = 
 Graph[edges, VertexLabels -> {x | y -> Automatic}, 
  VertexStyle -> {White, x | y -> Red}, 
  VertexSize -> {5, x | y -> 10}, 
  VertexLabelStyle -> {x | y -> Directive[Bold, Black, 20]}, 
  EdgeStyle -> {GrayLevel[0.75]}, 
  GraphLayout -> {"EdgeLayout" -> "HierarchicalEdgeBundling"}, 
  BaseStyle -> {Arrowheads -> 0.04}]

Unfortunately, all I get is a graphics object for output:

enter image description here

The best I can do is to run

SimpleGraph[g]

and that does produce this output enter image description here

But it seems that my code to color each of the 4 labeled vertices RED is not working; nor is my code to reduce the sizes of the arrows pointing into the circle's edge. Yet, my code for VertexLabelStyle is working.

Mentioned above, there are 1616 vertices. For this reason, I felt it is too large to include in this post; that is, in my code I have edges = {the set of 3315 directed edges}.

The labeled vertices N6065, N6037, N6073, and N6071 are vertices in the edges = {the set of 3315 directed edges} that I want to color RED, to make these 4 RED nodes larger than the others so they standout, and to control (reduce) the size of the arrows.

This is my first time trying the Hierarchical Edge Bundling feature. I have already review other posts on this topic. Any and all suggestions are most appreciated!!

$\endgroup$
2
  • $\begingroup$ I don't understand where the SimpleGraph[g] is coming from. If you make a Graph and it formats as a box instead of a graphic, try GraphPlot[g]. $\endgroup$
    – Jason B.
    Feb 2, 2022 at 18:55
  • $\begingroup$ I tried that too it looks worse than the above with SimpleGraph; with GraphPlot none of the node labels even appear. $\endgroup$
    – user42700
    Feb 3, 2022 at 1:04

1 Answer 1

0
$\begingroup$

For large graph, drawing code uses Point for vertex shape at default. You could specify PointSize to control vertex size and Arrowheads seems works fine:

Graph[edges, VertexLabels -> {x | y -> Automatic}, 
 VertexStyle -> {White, 
   x | y -> Directive[Red, AbsolutePointSize[5]]}, 
 VertexLabelStyle -> {x | y -> Directive[Bold, Black, 20]}, 
 EdgeStyle -> {GrayLevel[0.75]}, 
 GraphLayout -> {"EdgeLayout" -> "HierarchicalEdgeBundling"}, 
 BaseStyle -> {Arrowheads -> 0.01}]
$\endgroup$
1
  • $\begingroup$ No go ... thank u halmir, but I'm still getting the same issue I described above. $\endgroup$
    – user42700
    Feb 3, 2022 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.