Message Boards Message Boards

GROUPS:

Specify the coordinates of GraphPlot3D?

Posted 10 months ago
1156 Views
|
2 Replies
|
0 Total Likes
|

Hi?everyone! I want to draw a ladder graph, so I use the GridGraph[{2, 10}] . I'm especially looking forward to the new3D effects. So I use the GraphPlot3D, and I want to specify the coordinates in 3D graph. I want it to be output more regularly. How should I do? In graph, I know that to use the VertexCoordinates. But in 3D?I try but fail.

GridGraph[{2, 10}]
GraphPlot3D[EdgeList[GridGraph[{2, 10}]

enter image description here enter image description here

2 Replies
Posted 10 months ago

VertexCoordinates is usable in Graph3D[]:

pts = Flatten[PadRight[{{0, 0}, {1, 0}}, {2, 3}, #] & /@ Range[0, 9], 1];
Graph3D[EdgeList[GridGraph[{2, 10}]], VertexCoordinates -> pts]

However, if you insist on using GraphPlot3D[], the correct option to use is VertexCoordinateRules:

GraphPlot3D[GridGraph[{2, 10}], 
            VertexCoordinateRules -> MapIndexed[First[#2] -> #1 &, pts]]
POSTED BY: J. M.
Answer
Posted 9 months ago

Too many thanks to you! it solved my problem.

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