ColorFunction
グラフのエッジに色を付ける ために使用する 1 つの方法は次のとおりです。
ClearAll[colorededge];
colorededge[pts_, colorfunc_: Function[{x, y}, ColorData["TemperatureMap"][y]]] :=
ListPlot[pts, Joined -> True, PlotStyle -> Thick, Axes -> False,
ColorFunction -> colorfunc, ColorFunctionScaling -> True];
edgshpfnc = (If[Last[#2] == "B", First@colorededge[#1],
First@colorededge[#1, Function[{x, y}, Blend[{Yellow, Red}, x]]]] &);
Graph[{"A" -> "B", "B" -> "C", "C" -> "A"},
VertexCoordinates -> {"A" -> {0, 0}, "B" -> {1, 1}, "C" -> {2, 0}},
EdgeShapeFunction -> edgshpfnc, VertexLabels -> "Name", ImagePadding -> 10]
与える
と
GraphPlot[{"A" -> "B", "B" -> "C", "C" -> "A"},
EdgeRenderingFunction -> edgshpfnc, VertexLabeling -> True]
与える