0

我想创建一个带有节点标记的图。但是,当节点标签很长时,即使我使用节点的内部也不会填充style="filled"

这是我的代码和输出:

# Create an ndf with distinct labels and
# additional node attributes (where their classes
# will be inferred from the input vectors)
node_df <-
  create_node_df(
    n = 4,
    type = "a",
    label = c(23843333, 3333942, 836332, 21943333),
    style = "filled",
    color = "aqua",
    shape = c("circle", "circle",
              "rectangle", "rectangle"),
    value = c(3.5, 2.6, 9.4, 2.7))

# Display the node data frame
node_df
# }



# Create an edf with additional edge
# attributes (where their classes will
# be inferred from the input vectors)
edf <-
  create_edge_df(
    from = c(1, 2, 3, 4),
    to = c(4, 3, 1, 1),
    rel = "a",
    length = c(50, 100, 250, 100),
    color = "green",
    width = c(1, 5, 2, 3))

# Display the edge data frame
edf
# }

g <- create_graph(nodes_df = node_df, edges_df = edf)
render_graph(g)

图表输出

4

0 回答 0