Hi there,
I have be trying to draw a graph in which edges might have different
colors, nodes different sizes, etc.
My current code looks like this:
using Graphs
using IJuliaPortrayals
nnodes = 2
nedges = 2
vlist = Array(KeyVertex{Int64}, nnodes)
for i = 1:nnodes
vlist[i] = KeyVertex(i, i)
end
elist = Array(ExEdge{typeof(vlist[1])}, nedges)
elist[1] = ExEdge(1, vlist[1], vlist[2])
elist[1].attributes["color"] = "blue"
elist[2] = ExEdge(2, vlist[2], vlist[1])
elist[2].attributes["color"] = "red"
g = graph(vlist, elist, is_directed = true)
GraphViz(to_dot(g), "circo", "svg")
The "color" attributes was a hopeful attempt to pass the DOT
<https://en.wikipedia.org/wiki/DOT_(graph_description_language)> attribute
to GraphViz...
Running this code in IJulia, the result is:
<https://lh3.googleusercontent.com/-Pb2Hg1cd2hg/VyPXvpBrkAI/AAAAAAAABXU/gJi5Kuts1WgOwgsHku8AWt_XpjjjZhwdgCLcB/s1600/Screen%2BShot%2B2016-04-29%2Bat%2B5.52.38%2BPM.png>
Is there a way to change the color of the arrows? Also, is there any way to
have the image saved to a file?
Many thanks for any help!
Mathieu