Skip to main content
refactor
Source Link
framedWithColor[color_] := Function[{position, label},
  {Text[Framed[label, Background -> color], position]}
];

TreeForm[
  {{1, 2}, {3, 4}},
  VertexRenderingFunction -> ({
    Text[Framed[#2, Background -> LightBlue], #1]
  }&)framedWithColor[Pink]
]

enter image description hereenter image description here

TreeForm[
  {{1, 2}, {3, 4}},
  VertexRenderingFunction -> ({
    Text[Framed[#2, Background -> LightBlue], #1]
  }&)
]

enter image description here

framedWithColor[color_] := Function[{position, label},
  {Text[Framed[label, Background -> color], position]}
];

TreeForm[
  {{1, 2}, {3, 4}},
  VertexRenderingFunction -> framedWithColor[Pink]
]

enter image description here

Source Link

TreeForm[
  {{1, 2}, {3, 4}},
  VertexRenderingFunction -> ({
    Text[Framed[#2, Background -> LightBlue], #1]
  }&)
]

enter image description here