Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nodeList = {a, b, c};
- edgeList = {a <-> b, b <-> c, c <-> a};
- aShape = ToExpression["$c=\sqrt{a^2+b^2}$", TeXForm, HoldForm];
- bShape = ToExpression["$c=\sqrt{b^2+a^2}$", TeXForm, HoldForm];
- cShape = ToExpression["$\text{Area equals A}$", TeXForm, HoldForm];
- Print["The 3 labels are: ", {aShape, bShape, cShape}];
- shapeList = {a -> aShape, b -> bShape, c -> cShape};
- g = Graph[nodeList, edgeList, VertexShape -> shapeList, VertexSize -> Large]
- asc = <|a -> aShape, b -> bShape, c -> cShape|>
- Graph[nodeList, edgeList,
- VertexShapeFunction -> (Inset[Framed@StandardForm@asc[#2], #1] &),
- PerformanceGoal -> "Quality",
- VertexStyle -> Black
- ]
- <<IGraphM`
- IGExpressionTree[First@Roots[x^2 + a x + 1 == 0, x],
- VertexLabels -> "Subexpression",
- PerformanceGoal -> "Quality",
- ImageSize -> 280
- ] //
- IGVertexMap[
- Function[e, Inset[Panel[e], #1] &],
- VertexShapeFunction -> IGVertexProp[VertexLabels]
- ] // RemoveProperty[#, VertexLabels] &
- a = "c=\sqrt{a^2+b^2}";
- b = "c=\sqrt{b^2+a^2}";
- c = "\text{Area equals A}";
- << MaTeX`
- Graph[{a <-> b, b <-> c, c <-> a},
- VertexShapeFunction ->
- Function[{position, vertex, size}, Inset[Framed[MaTeX[vertex], FrameStyle -> None], position]],
- PerformanceGoal -> "Quality"
- ]
Add Comment
Please, Sign In to add comment