Hello Julia community. I am using Julia v.0.6.4
to make visualization for a structural analysis of a linear system. And for this I am using graphs from LightGraphs.jl
and specifically directed graphs function DiGraph()
.
I’ve got a problem with representation of vertices that direct an edge to itself. This is a diagonal elements on a matrix that is used for the graph creation. See example for better understanding:
using LightGraphs
using GraphPlot
A = [-4.36928 2.86758e-11 -0.000334885 7.71247e-6 -1.52591e-9;
0.0 0.0 0.0 0.0 0.0;
4.21327 3.43463e-10 -0.00401345 -1.10343e-5 1.47294e-9;
0.0 0.0 997.0 0.0 0.0;
0.0 0.0 0.0 0.0 0.0]
G = DiGraph(A)
gplot(G, nodelabel=1:size(A)[1])
I showed the problematic edges with red circles. It is visible that sometimes it is really hard to notice them, e.g. self edge to vertex #3 is invisible due to other edges, however it exists which is seen from matrix A (i.e. A[3,3] element).
I would like to ask if it somehow possible to make these edges look a bit different, e.g., as in the fig. below.
I’ve seen that it is possible to manipulate with edges’ line width, color, arrow length or angle. And for now I’ve used a different color for such self edges. However, it would be interesting to know if it is possible to make this more efficient?