GraphPlotの機能が,新しく加わった組込みの Mathematica カーネル関数GraphPlotおよびLayeredGraphPlotで利用できるようになった.
GraphPlot3Dが新しく加わった組込みの Mathematica カーネル関数GraphPlot3Dで利用できるようになった.
TreePlotが,新しく加わった組込みの Mathematica カーネル関数TreePlotで利用できるようになった.
EdgeStyleFunctionオプションが,新しく加わった組込みの Mathematica カーネルオプションEdgeShapeFunctionとして利用できるようになった.
TreeSizeFunctionオプションが新しく加わった組込みの Mathematica カーネルオプションLayerSizeFunctionとして利用できるようになった.
VertexCoordinatesオプションが新しく加わった組込みの Mathematica カーネルオプションVertexCoordinatesとして利用できるようになった.
VertexStyleFunctionオプションが新しく加わった組込みの Mathematica カーネルオプションVertexShapeFunctionとして利用できるようになった.
RootPositionオプションが組込みの Mathematica カーネル関数TreePlotの第2引数として利用できるようになった.
GraphPlot
g = GraphPlot[{2 -> 1, 3 -> 1, 3 -> 2, 4 -> 1, 4 -> 2, 5 -> 1, 5 -> 2}]GraphPlot3D
GraphPlot3D[{2 -> 1, 3 -> 1, 3 -> 2, 4 -> 1, 4 -> 2, 5 -> 1, 5 -> 2}]TreePlot
g = Flatten[Table[{i -> 2 * i, i -> 2 * i + 1}, {i, 2 ^ 4 - 1}]]
TreePlot[g]EdgeStyleFunction
EdgeShapeFunctionを使って,辺の描画方法を制御する:
GraphPlot[Table[1, {30}, {30}], EdgeShapeFunction -> None]GraphPlot[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 5, 5 -> 6, 6 -> 7, 7 -> 8, 8 -> 1,
1 -> 9, 2 -> 9, 3 -> 10, 4 -> 10, 6 -> 11, 5 -> 11, 7 -> 12, 8 -> 12},
EdgeShapeFunction -> (Arrow[#1] &)]GraphPlot[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 5, 5 -> 6, 6 -> 7, 7 -> 8, 8 -> 1,
1 -> 9, 2 -> 9, 3 -> 10, 4 -> 10, 6 -> 11, 5 -> 11, 7 -> 12, 8 -> 12},
DirectedEdges -> True]LayerSizeFunction
g = Flatten[Table[{i -> 2 * i, i -> 2 * i + 1}, {i, 2 ^ 4 - 1}]]
TreePlot[g]以下でも同じグラフを描画するが.各レベルの高さ i が1/i2に比例するようにする:
TreePlot[g, LayerSizeFunction -> (1 / # ^ 2 &)]VertexCoordinates
VertexCoordinatesを使うと,頂点の座標を明示的に指定することができる:
GraphPlot[{1 -> 3, 1 -> 4, 2 -> 4, 2 -> 5, 3 -> 5, 6 -> 7, 7 -> 8, 8 -> 9, 9 -> 10, 6 -> 10, 1 -> 6, 2 -> 7, 3 -> 8, 4 -> 9, 5 -> 10}, VertexCoordinates -> {{0.309017, 0.951057}, {-0.809017, -0.587785}, {0.309017, -0.951057}, {-0.809017, 0.587785}, {1., 0}, {0.618034, 1.90211}, {-1.61803, 1.17557}, {-1.61803, -1.17557}, {0.618034, -1.90211}, {2., 0}}]VertexStyleFunction
VertexShapeFunctionを使うと頂点の描画方法が制御できる.以下では頂点を描画しない:
GraphPlot[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 5, 5 -> 6, 6 -> 1}, VertexShapeFunction -> None]GraphPlot[{1 -> 2, 1 -> 3, 1 -> 4, 2 -> 3, 2 -> 4, 3 -> 5, 4 -> 6, 5 -> 7, 5 -> 8, 6 -> 7, 6 -> 8, 7 -> 8}, VertexShapeFunction -> ({Hue[.7], Disk[#, 0.05]} &)]RootPosition (TreePlotの引数)
TreePlot[{1 -> 2, 2 -> 4, 3 -> 6, 4 -> 8, 5 -> 10, 6 -> 12, 1 -> 3, 2 -> 5, 3 -> 7, 4 -> 9, 5 -> 11, 6 -> 13}, Left]DiscreteMath`GraphPlot`の関数の多くが組込みの Mathematica カーネル関数として利用できるようになった.
GraphPlot[g = {1 -> 2, 1 -> 6, 1 -> 7, 2 -> 3, 2 -> 7, 3 -> 30, 3 -> 26, 3 -> 4, 3 -> 32, 4 -> 5, 4 -> 9, 5 -> 9, 5 -> 10, 6 -> 7, 6 -> 11, 7 -> 8, 7 -> 30, 7 -> 12, 8 -> 9, 8 -> 26, 8 -> 13, 9 -> 10, 9 -> 32, 9 -> 14, 10 -> 15, 11 -> 16, 11 -> 27, 11 -> 30, 11 -> 35, 12 -> 13, 12 -> 17, 12 -> 27, 13 -> 31, 13 -> 33, 13 -> 14, 13 -> 36, 13 -> 18, 13 -> 34, 14 -> 28, 14 -> 19, 15 -> 32, 15 -> 28, 15 -> 37, 15 -> 20, 16 -> 17, 16 -> 21, 17 -> 21, 17 -> 22, 17 -> 35, 17 -> 18, 18 -> 19, 18 -> 29, 19 -> 37, 19 -> 20, 19 -> 24, 19 -> 25, 20 -> 25, 21 -> 22, 22 -> 23, 23 -> 24, 23 -> 29, 23 -> 35, 23 -> 37, 24 -> 25, 30 -> 31, 32 -> 33, 34 -> 35, 36 -> 37}]ug = Join[g, Reverse /@ g];
GraphDiameter[ug]GraphDistance[ug, 1, 25]