跳到内容

同名的现有属性将被覆盖。

用法

set_graph_attr(graph, name, value)

参数

graph

图。

name

要设置的属性的名称。

value

属性的新值。

添加或设置新图属性的图。

示例

g <- make_ring(10) %>%
  set_graph_attr("layout", layout_with_fr)
g
#> IGRAPH 6201dd2 U--- 10 10 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l), layout (g/x)
#> + edges from 6201dd2:
#>  [1] 1-- 2 2-- 3 3-- 4 4-- 5 5-- 6 6-- 7 7-- 8 8-- 9 9--10 1--10
plot(g)