首页 > 解决方案 > DiagrammeR - 如何将标签移动到节点之外

问题描述

如何使用 R 的 DiagrammeR 包将标签移出圆圈?我在说明手册中没有看到任何内容。这是我的代码。在我看来,将标签放在圆圈内并不吸引人。如果我能申请ggrepelDiagrammeR将是理想的,尽管我怀疑这是可能的。

library(DiagrammeR)
grViz("
digraph neato {

graph [layout = neato]

node [shape = circle,
      style = filled,
      color = grey,
      label = '']

node [fillcolor = red]
a [label='Amelia Arduino', fixedsize = true]

node [fillcolor = green]
b c d

node [fillcolor = orange]

l [label = 'Larry Lamp', fixedsize = true]

edge [color = grey]
a -> {b c d}
b -> {e f g h i j}
c -> {k l m n o [label = 'Ophelia Oz', fixedsize = true] 
p [label = 'Peter Pete', fixedsize = true]}
d -> {q r s t u v}
}")

在此处输入图像描述

标签: rorgchartdiagrammerggrepel

解决方案


推荐阅读