How to customize arrow of directed graph (digraph)
Show older comments
I am attempting to plot a weighted directed graph that displays weights via augmenting edge thickness. My (pseduo)code thus far is:
G=digraph(weights);
G.Edges.Weight=weightsVec;
G.Edges.LWidths = 6*G.Edges.Weight/max(G.Edges.Weight);
p=plot(G);
p.LineWidth=G.Edges.LWidths;
p.ArrowSize=15;
This works pretty well, but I find that the increased edge widths covers up arrowheads on some of the edges. An obvious fix would be to use larger arrowheads, but this usually ends up looking terrible if your graph has many connections of varying weights (arrowheads look ridiculously large for weights of smaller magnitute). Another way to fix this would be to change the color of the arrowhead (and not the edge, itself) or change the position of the arrowhead to the end of the edge line. Both options appear to be unavailable for the directed graph object. Does anyone have any workarounds?
P.S. I know that there is an option to use a color scale to display edge weights, but I am trying to avoid this approach.
Accepted Answer
More Answers (0)
Categories
Find more on Graph and Network Algorithms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!