I have the following list of rules:
L={1->2,2->3,3->3};
and I want to plot a tree graph:
TreePlot[L,VertexRenderingFunction->({Disk[#,.02],Text[#2,#1+{.15,0}]}&)]
The thing is, I would like to have the arrows only on certain lines, such as the second one, 2->3
. To this end, I shall write the rules as
L={{1->2,2->3,3->3},{False,True,False}};
and generate the tree by TreePlot[L[[1]],...]
. My question is: how can I get the arrows only at True
positions, as in the example above?
I thought I could use directed edges and undirected edges, that is,
L={UndirectedEdge[1,2],DirectedEdge[2,3],UndirectedEdge[3,3]};
but i get the message TreePlot::grph:L is not a valid graph.
How can I make it work?
TreePlot
. UseGraph
instead withGraphLayout
$\endgroup$GraphLayout
doc page. There's a lot of information squeezed in there about lots and lots of different layout methods, their suboptions, etc. It's a bit confusion as usually this amount of stuff wouldn't be hidden behind a single options and its suboptions. It's too easy to miss. $\endgroup$