I set my custom graph with vertex names like ell
, poll
, novi
etc. (not numbers, but symbolic names). And I set vertexes and edges weights (weights can be positive or negative). I want to set different style parameters of vertexes and edges based on those weights. How can I do that? Thank you.
Graph[
{
Labeled[
Property[
vat, {VertexSize -> (.567 + .7)/3,
VertexStyle -> Hue[.567/3 + .75, 1, 1]}], ""],
Labeled[
Property[
elch, {VertexSize -> (-.608 + .7)/3,
VertexStyle -> Hue[-.608/3 + .75, 1, 1]}], ""],
Labeled[
Property[
ion, {VertexSize -> (-.025 + .7)/3,
VertexStyle -> Hue[-.025/3 + .75, 1, 1]}], ""],
Labeled[
Property[
kar, {VertexSize -> (-.167 + .7)/3,
VertexStyle -> Hue[-.167/3 + .75, 1, 1]}], ""],
Labeled[
Property[
kos, {VertexSize -> (-.400 + .7)/3,
VertexStyle -> Hue[-.400/3 + .75, 1, 1]}], ""],
Labeled[
Property[
lap, {VertexSize -> (.408 + .7)/3,
VertexStyle -> Hue[.408/3 + .75, 1, 1]}], ""],
Labeled[
Property[
mas, {VertexSize -> (-.050 + .7)/3,
VertexStyle -> Hue[-.050/3 + .75, 1, 1]}], ""],
Labeled[
Property[
novi, {VertexSize -> (.258 + .7)/3,
VertexStyle -> Hue[.258/3 + .75, 1, 1]}], ""],
Labeled[
Property[
novo, {VertexSize -> (-.033 + .7)/3,
VertexStyle -> Hue[-.033/3 + .75, 1, 1]}], ""],
Labeled[
Property[
pod, {VertexSize -> (-.083 + .7)/3,
VertexStyle -> Hue[-.083/3 + .75, 1, 1]}], ""],
Labeled[
Property[
pol, {VertexSize -> (.142 + .7)/3,
VertexStyle -> Hue[.142/3 + .75, 1, 1]}], ""],
Labeled[
Property[
sar, {VertexSize -> (.025 + .7)/3,
VertexStyle -> Hue[.025/3 + .75, 1, 1]}], ""],
Labeled[
Property[
sok, {VertexSize -> (-.142 + .7)/3,
VertexStyle -> Hue[-.142/3 + .75, 1, 1]}], ""],
Labeled[
Property[
sut, {VertexSize -> (.067 + .7)/3,
VertexStyle -> Hue[.067/3 + .75, 1, 1]}], ""],
Labeled[
Property[
ust, {VertexSize -> (-.050 + .7)/3,
VertexStyle -> Hue[-.050/3 + .75, 1, 1]}], ""],
Labeled[
Property[
ell, {VertexSize -> (.117 + .7)/3,
VertexStyle -> Hue[.117/3 + .75, 1, 1]}], ""]
}
,
{
Property[vat -> elch, EdgeWeight -> -9],
Property[vat -> kar, EdgeWeight -> 3],
Property[vat -> kos, EdgeWeight -> -4],
Property[vat -> lap, EdgeWeight -> 5],
Property[vat -> mas, EdgeWeight -> -1],
Property[vat -> novi, EdgeWeight -> 1],
Property[vat -> novo, EdgeWeight -> 1],
Property[vat -> pod, EdgeWeight -> -2],
Property[vat -> pol, EdgeWeight -> 4],
Property[vat -> sut, EdgeWeight -> 2],
Property[kar -> vat, EdgeWeight -> 9],
Property[kar -> elch, EdgeWeight -> -9],
Property[kar -> ion, EdgeWeight -> -1],
Property[kar -> lap, EdgeWeight -> 1],
Property[kar -> mas, EdgeWeight -> -2],
Property[kar -> novi, EdgeWeight -> 4],
Property[kar -> novo, EdgeWeight -> 1],
Property[kar -> sar, EdgeWeight -> 1],
Property[kar -> sok, EdgeWeight -> -4],
Property[kar -> ust, EdgeWeight -> -2],
Property[sok -> vat, EdgeWeight -> 2],
Property[sok -> elch, EdgeWeight -> -4],
Property[sok -> ion, EdgeWeight -> -3],
Property[sok -> kar, EdgeWeight -> -4],
Property[sok -> kos, EdgeWeight -> -3],
Property[sok -> lap, EdgeWeight -> 3],
Property[sok -> novi, EdgeWeight -> 1],
Property[sok -> novo, EdgeWeight -> 1],
Property[sok -> pod, EdgeWeight -> -1],
Property[sok -> pol, EdgeWeight -> -3],
Property[sok -> sar, EdgeWeight -> 2],
Property[sok -> sut, EdgeWeight -> 2],
Property[sok -> ell, EdgeWeight -> 7],
Property[novo -> vat, EdgeWeight -> 6],
Property[novo -> elch, EdgeWeight -> 3],
Property[novo -> ion, EdgeWeight -> -2],
Property[novo -> kar, EdgeWeight -> -2],
Property[novo -> kos, EdgeWeight -> -3],
Property[novo -> lap, EdgeWeight -> 1],
Property[novo -> pod, EdgeWeight -> -1],
Property[novo -> sok, EdgeWeight -> -2],
Property[novo -> sut, EdgeWeight -> 1],
Property[novo -> ust, EdgeWeight -> -3],
Property[novo -> ell, EdgeWeight -> 2],
Property[sut -> vat, EdgeWeight -> 7],
Property[sut -> elch, EdgeWeight -> -3],
Property[sut -> kar, EdgeWeight -> -6],
Property[sut -> kos, EdgeWeight -> -6],
Property[sut -> lap, EdgeWeight -> -1],
Property[sut -> novi, EdgeWeight -> 6],
Property[sut -> novo, EdgeWeight -> -1],
Property[sut -> pol, EdgeWeight -> 4],
Property[novi -> vat, EdgeWeight -> 3],
Property[novi -> elch, EdgeWeight -> -3],
Property[novi -> kar, EdgeWeight -> 2],
Property[novi -> kos, EdgeWeight -> -7],
Property[novi -> lap, EdgeWeight -> 6],
Property[novi -> mas, EdgeWeight -> 1],
Property[novi -> novo, EdgeWeight -> -1],
Property[novi -> pol, EdgeWeight -> 3],
Property[novi -> sut, EdgeWeight -> -2],
Property[novi -> ust, EdgeWeight -> -1],
Property[novi -> ell, EdgeWeight -> 3],
Property[lap -> vat, EdgeWeight -> 8],
Property[lap -> elch, EdgeWeight -> -2],
Property[lap -> ion, EdgeWeight -> 1],
Property[lap -> kar, EdgeWeight -> 1],
Property[lap -> kos, EdgeWeight -> -3],
Property[lap -> mas, EdgeWeight -> -3],
Property[lap -> novi, EdgeWeight -> 4],
Property[lap -> novo, EdgeWeight -> -1],
Property[lap -> sar, EdgeWeight -> -4],
Property[lap -> sok, EdgeWeight -> -2],
Property[lap -> ell, EdgeWeight -> 1],
Property[ell -> vat, EdgeWeight -> 3],
Property[ell -> elch, EdgeWeight -> -8],
Property[ell -> kar, EdgeWeight -> 1],
Property[ell -> kos, EdgeWeight -> -2],
Property[ell -> lap, EdgeWeight -> 6],
Property[ell -> mas, EdgeWeight -> -3],
Property[ell -> novi, EdgeWeight -> 1],
Property[ell -> novo, EdgeWeight -> -2],
Property[ell -> pol, EdgeWeight -> 5],
Property[ell -> sok, EdgeWeight -> -3],
Property[ell -> sut, EdgeWeight -> 2],
Property[ust -> vat, EdgeWeight -> 6],
Property[ust -> elch, EdgeWeight -> -8],
Property[ust -> ion, EdgeWeight -> 2],
Property[ust -> kos, EdgeWeight -> -7],
Property[ust -> lap, EdgeWeight -> 2],
Property[ust -> novi, EdgeWeight -> 2],
Property[ust -> pod, EdgeWeight -> 1],
Property[ust -> pol, EdgeWeight -> 2],
Property[ust -> sok, EdgeWeight -> -2],
Property[ust -> sut, EdgeWeight -> 2],
Property[mas -> vat, EdgeWeight -> 3],
Property[mas -> elch, EdgeWeight -> -9],
Property[mas -> kar, EdgeWeight -> -2],
Property[mas -> kos, EdgeWeight -> -5],
Property[mas -> lap, EdgeWeight -> 8],
Property[mas -> novi, EdgeWeight -> 1],
Property[mas -> pod, EdgeWeight -> -2],
Property[mas -> pol, EdgeWeight -> 1],
Property[mas -> sar, EdgeWeight -> 4],
Property[mas -> ell, EdgeWeight -> 1],
Property[sar -> vat, EdgeWeight -> 5],
Property[sar -> elch, EdgeWeight -> -7],
Property[sar -> kar, EdgeWeight -> -3],
Property[sar -> kos, EdgeWeight -> -4],
Property[sar -> lap, EdgeWeight -> 8],
Property[sar -> mas, EdgeWeight -> 2],
Property[sar -> novi, EdgeWeight -> 3],
Property[sar -> pod, EdgeWeight -> -4],
Property[ion -> vat, EdgeWeight -> 9],
Property[ion -> elch, EdgeWeight -> -1],
Property[ion -> kar, EdgeWeight -> -9],
Property[ion -> kos, EdgeWeight -> -4],
Property[ion -> lap, EdgeWeight -> 6],
Property[ion -> novi, EdgeWeight -> 2],
Property[ion -> novo, EdgeWeight -> -1],
Property[ion -> pod, EdgeWeight -> -1],
Property[ion -> pol, EdgeWeight -> 1],
Property[ion -> sok, EdgeWeight -> -2],
Property[pod -> vat, EdgeWeight -> 7],
Property[pod -> elch, EdgeWeight -> -9],
Property[pod -> ion, EdgeWeight -> -2],
Property[pod -> kar, EdgeWeight -> -1],
Property[pod -> lap, EdgeWeight -> 4],
Property[pod -> novi, EdgeWeight -> 6],
Property[pod -> novo, EdgeWeight -> -1],
Property[pod -> sok, EdgeWeight -> -2],
Property[pod -> sut, EdgeWeight -> 1]
},
EdgeShapeFunction ->
GraphElementData[{"CarvedArrow", "ArrowSize" -> .01}],
GraphLayout -> "CircularEmbedding",
EdgeStyle ->
Thread[a ->
Transpose@{Dashing /@ ((b + 0.5)/10), Hue /@ (b + 0.5),
Thickness /@ ((b + 0.5)/100)}]
]
You didn't give much info about your graph, but this is a way to let the different
EdgeStyle
characteristics be defined byEdgeWeight
.Edit: