Guest User

Untitled

a guest
Jan 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. g =
  2. Graph[{2 [DirectedEdge] 3},
  3. VertexLabels -> "Name", EdgeLabels -> {2 [DirectedEdge] 3 -> "hallo"}]
  4.  
  5. g1 = VertexReplace[g, Thread[VertexList[g] -> ToString /@ VertexList[g]]];
  6.  
  7. g =
  8. Graph[{{1,2} [DirectedEdge] {2,3}},
  9. VertexLabels -> "Name", EdgeLabels -> {{1,2} [DirectedEdge] {2,3} -> "hallo"}]
  10.  
  11. In[15]:= Fold[
  12. SetProperty[{#1, #2}, VertexLabels -> ToString[#2]] &, g,
  13. VertexList[g]]
  14.  
  15. During evaluation of In[15]:= SetProperty::pvobj: $Failed is not an object with properties.
  16.  
  17. Out[15]= SetProperty[{$Failed, {2, 3}}, VertexLabels -> "{2, 3}"]
  18.  
  19. g =
  20. Graph[{2 [DirectedEdge] 3},
  21. VertexLabels -> "Name",
  22. EdgeLabels -> {2 [DirectedEdge] 3 -> Style[" hello ", Background -> White]}]
  23.  
  24. Fold[SetProperty[{#1, #2}, VertexLabels -> ToString[#2] <> "*"] &, g, VertexList[g]]
Add Comment
Please, Sign In to add comment