View source: R/mully_visualization.R
plot3d | R Documentation |
Plot the graph in 3D using rgl
plot3d( g, layers = TRUE, vertex.label = NA, vertex.label.color = NA, vertex.plac = "circle", edge.color = NA, edge.width = 5, edge.arrow.size = 10, edge.arrow.width = 1 )
g |
The input graph |
layers |
A boolean whether to add the layers or not |
vertex.label |
The vertices' labels |
vertex.label.color |
The vertices' colors. If not specified, the colors will be chosen randomly |
vertex.plac |
The placement form of the vertices on the layer. Can either be "circle" which will place them on a circle, or "disc" which will place them randomly on a disc. The default is "circle" |
edge.color |
The edges' colors. If not specified, inter-edges are black, and intra-edges have the same color as the nodes on the layer |
edge.width |
The edge width. Default set to 5. |
edge.arrow.size |
The edges' arrow size. Default set to 10 |
edge.arrow.width |
The edges' arrow width. Default set to 1 |
No return value. A 3D plot of the given graph is created.
This function can take the following arguments supported and not ignored by rglplot: vertex.label, vertex.label.color, edge.color, edge.width, edge.arrow.size,edge.arrow.width.
g=mully::demo() labels=getNodeAttributes(g)$name plot3d(g, layers=TRUE, vertex.label=labels,edge.width=6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.