MATLAB: Is it possible to set an alpha value for each edge in a GraphPlot

graphgraph theoryMATLABplotting

Colours for individual edges can be set.
% For individual edges
highlight(H, edge_idx, 'EdgeColour', [1,0,0]);
% For all edges
H.EdgeColour = % matrix with RGB-values for each edge
Opacity for all edges in the graph can be set, too.
H.EdgeAlpha = 0.01;
Unfortunately I cannot find a way to set alpha values for individual edges. Ideally, there should be a fourth channel in H.EdgeColour to control opacity.
Has anyone found a workaround?

Best Answer

Hi Michael,
We do not provide a way to set EdgeAlpha to be different for each edge. We just didn't expect this to be very useful, thinking it would be hard to read these subtle differences in a graph.
For the special case where you want all edges to either have the same alpha or be completely transparent, you could instead use 'LineStyle', 'none' to make some edges completely invisible (use the highlight method for a simpler way to do this).
If you are looking for something else, could you tell me more about what you are doing? What do the different alpha's represent? Are there only a few different alpha values, or is each one slightly different?