View source: R/annotate_functions.R
annotate_circle | R Documentation |
annotate concentric circles
annotate_circle(cent, col = "#00BFFF", format = "", pos = "top", text_size = 3)
cent |
centrality scores used for layout |
col |
color of text |
format |
either empty string or 'scientific' |
pos |
position of text ('top' or 'bottom') |
text_size |
font size for annotations |
this function is best used with layout_with_centrality together with draw_circle.
annotated concentric circles around origin
library(igraph)
g <- sample_gnp(10, 0.4)
## Not run:
library(ggraph)
ggraph(g, layout = "centrality", centrality = closeness(g)) +
draw_circle(use = "cent") +
annotate_circle(closeness(g), pos = "bottom", format = "scientific") +
geom_edge_link() +
geom_node_point(shape = 21, fill = "grey25", size = 5) +
theme_graph() +
coord_fixed()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.