Message Boards Message Boards

0
|
6122 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Draw arch graph on an existing linear graph?

After plotting this Graph,

How do I visualize 3->14, 4->13, 6->9 that will be drawn above the number line like a loop or circle?

Graph[Flatten[
  Thread[{#[[1]]} -> {#[[2]]}] & /@ Partition[Range[15], 2, 1]], 
 VertexLabels -> Automatic]

enter image description here

POSTED BY: Manjunath Babu
g1=PathGraph[Range[15],
    DirectedEdges->True,
    VertexLabels->Automatic,
    VertexCoordinates->Thread[{Range[15],0}]]

g2=Graph[{3,4,6,9,13,14},{3->14,4->13,6->9},
    GraphLayout->"LinearEmbedding",
    VertexCoordinates->{{3,0},{4,0},{6,0},{9,0},{13,0},{14,0}}]

Show[g1, g2] /. {Arrowheads[x_] -> Arrowheads[.02], Arrow[x_] -> {Arrowheads[.02], Arrow[x]}}

enter image description here

POSTED BY: Vitaliy Kaurov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract