Я пытаюсь создать легенду для моей блок-схемы диаграммы.Пока что у меня есть созданная блок-схема, но я не знаю, как добавить легенду для объяснения моей нумерации.
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']
}")
Это то, что я хотел бы:
