Guest User

Untitled

a guest
Jan 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. nodeList = {a, b, c};
  2. edgeList = {a <-> b, b <-> c, c <-> a};
  3. aShape = ToExpression["$c=\sqrt{a^2+b^2}$", TeXForm, HoldForm];
  4. bShape = ToExpression["$c=\sqrt{b^2+a^2}$", TeXForm, HoldForm];
  5. cShape = ToExpression["$\text{Area equals A}$", TeXForm, HoldForm];
  6. Print["The 3 labels are: ", {aShape, bShape, cShape}];
  7. shapeList = {a -> aShape, b -> bShape, c -> cShape};
  8. g = Graph[nodeList, edgeList, VertexShape -> shapeList, VertexSize -> Large]
  9.  
  10. asc = <|a -> aShape, b -> bShape, c -> cShape|>
  11.  
  12. Graph[nodeList, edgeList,
  13. VertexShapeFunction -> (Inset[Framed@StandardForm@asc[#2], #1] &),
  14. PerformanceGoal -> "Quality",
  15. VertexStyle -> Black
  16. ]
  17.  
  18. <<IGraphM`
  19. IGExpressionTree[First@Roots[x^2 + a x + 1 == 0, x],
  20. VertexLabels -> "Subexpression",
  21. PerformanceGoal -> "Quality",
  22. ImageSize -> 280
  23. ] //
  24. IGVertexMap[
  25. Function[e, Inset[Panel[e], #1] &],
  26. VertexShapeFunction -> IGVertexProp[VertexLabels]
  27. ] // RemoveProperty[#, VertexLabels] &
  28.  
  29. a = "c=\sqrt{a^2+b^2}";
  30. b = "c=\sqrt{b^2+a^2}";
  31. c = "\text{Area equals A}";
  32.  
  33. << MaTeX`
  34.  
  35. Graph[{a <-> b, b <-> c, c <-> a},
  36. VertexShapeFunction ->
  37. Function[{position, vertex, size}, Inset[Framed[MaTeX[vertex], FrameStyle -> None], position]],
  38. PerformanceGoal -> "Quality"
  39. ]
Add Comment
Please, Sign In to add comment