我正在尝试为我的图表流程图创建图例。到目前为止,我已经创建了流程图,但是我不知道如何添加图例来解释我的编号。
library(DiagrammeR)
grViz("
digraph dot {
graph [layout = dot,
rankdir = LR]
node [shape = square,
style = filled,
color = grey,
fontname = Helvetica]
node [fillcolor = white]
a [label = 'Location 1']
node [fillcolor = green]
b [label = 'Location 2']
node [fillcolor = orange]
c [label = 'Location 3']
d [label = 'Location 4']
edge [color = grey]
a -> {b} [label = '1,2']
b -> {c} [label = '1']
b -> {d} [label = '2']
}")
这就是我想要的: