Learn R Programming

graphlayouts (version 0.2.0)

layout_igraph_focus: Focal layout

Description

puts a focal node in the center and arrange other nodes in concentric circles according to distances.

Usage

layout_igraph_focus(g, v, iter = 500, tol = 1e-04, circular)

layout_with_focus(g, v, iter = 500, tol = 1e-04)

Arguments

g

igraph object

v

focal node to be placed in the center

iter

number of iterations

tol

stopping criterion

circular

not used

Value

coordinates to be used layouting a graph

Details

the layout_igraph_* function should not be used directly. It is only used as an argument for 'ggraph'.

References

Brandes, U., & Pich, C. (2011). More flexible radial layout. Journal of Graph Algorithms and Applications, 15(1), 157-173.

Examples

Run this code
# NOT RUN {
library(igraph)
library(ggraph)
g <- sample_gnp(10,0.4)
ggraph(g,layout = "focus",v = 1)+
  draw_circle(use = "focus", max.circle = max(distances(g,1)))+
  geom_edge_link()+
  geom_node_point(shape = 21,fill = "grey25",size = 5)+
  theme_graph()+
  coord_fixed()
# }

Run the code above in your browser using DataLab