Skip to main content
added 530 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
ttF = Tooltip[#, "The Iliad of Homer"] &;

Use "The Iliad of Homer" as the tooltip for the nodes and the edge:

TreePlot[{ttF[# -> #2] & @@ ttF /@ {Peleus, Achiles}},  VertexLabeling -> All]

enter image description here

Alternatively, (1) Use the syntax $\left\{\left\{v_i\to v_j,\text{lbl}_1\right\},\ldots \right\}$ instead of $\left\{v_i\to v_j,v_{2 i}\to v_{2 j},\ldots \right\}$ to specify the edges. (2) Use the option settings VertexLabeling -> All and EdgeLabeling -> Automatic. (3) Post-process the TreePlot output to change the Tooltip labels.

TreePlot[{{Peleus -> Achiles, ""}}, VertexLabeling -> All, EdgeLabeling -> Automatic] /. 
      Tooltip[v_, _] :> Tooltip[v, "The Iliad of Homer"]
(* same picture *)
ttF = Tooltip[#, "The Iliad of Homer"] &;

Use "The Iliad of Homer" as the tooltip for the nodes and the edge:

TreePlot[{ttF[# -> #2] & @@ ttF /@ {Peleus, Achiles}},  VertexLabeling -> All]

enter image description here

ttF = Tooltip[#, "The Iliad of Homer"] &;

Use "The Iliad of Homer" as the tooltip for the nodes and the edge:

TreePlot[{ttF[# -> #2] & @@ ttF /@ {Peleus, Achiles}},  VertexLabeling -> All]

enter image description here

Alternatively, (1) Use the syntax $\left\{\left\{v_i\to v_j,\text{lbl}_1\right\},\ldots \right\}$ instead of $\left\{v_i\to v_j,v_{2 i}\to v_{2 j},\ldots \right\}$ to specify the edges. (2) Use the option settings VertexLabeling -> All and EdgeLabeling -> Automatic. (3) Post-process the TreePlot output to change the Tooltip labels.

TreePlot[{{Peleus -> Achiles, ""}}, VertexLabeling -> All, EdgeLabeling -> Automatic] /. 
      Tooltip[v_, _] :> Tooltip[v, "The Iliad of Homer"]
(* same picture *)
added 1 character in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
ttF = Tooltip[#, "The Iliad of Homer"] &;

Use `"The Iliad of Homer""The Iliad of Homer" as the tooltip for the nodes and the edge:

TreePlot[{ttF[# -> #2] & @@ ttF /@ {Peleus, Achiles}},  VertexLabeling -> All]

enter image description here

ttF = Tooltip[#, "The Iliad of Homer"] &;

Use `"The Iliad of Homer" as the tooltip for the nodes and the edge:

TreePlot[{ttF[# -> #2] & @@ ttF /@ {Peleus, Achiles}},  VertexLabeling -> All]

enter image description here

ttF = Tooltip[#, "The Iliad of Homer"] &;

Use "The Iliad of Homer" as the tooltip for the nodes and the edge:

TreePlot[{ttF[# -> #2] & @@ ttF /@ {Peleus, Achiles}},  VertexLabeling -> All]

enter image description here

Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

ttF = Tooltip[#, "The Iliad of Homer"] &;

Use `"The Iliad of Homer" as the tooltip for the nodes and the edge:

TreePlot[{ttF[# -> #2] & @@ ttF /@ {Peleus, Achiles}},  VertexLabeling -> All]

enter image description here