I would like to combine different DiagrammeR
plots into a single figure. The plots are generated as the following example:
library(DiagrammeR)
pDia <- grViz("
digraph boxes_and_circles {
# a 'graph' statement
graph [overlap = true, fontsize = 10]
# several 'node' statements
node [shape = box,
fontname = Helvetica]
A; B; C; D; E; F
node [shape = circle,
fixedsize = true,
width = 0.9] // sets as circles
1; 2; 3; 4; 5; 6; 7; 8
# several 'edge' statements
A->1 B->2 B->3 B->4 C->A
1->D E->A 2->4 1->5 1->F
E->6 4->6 5->7 6->7 3->8
}
")
pDia
Therefore, I would like to combine plots like pDia
, class "grViz" "htmlwidget"
, into a single image with labels such A
, B
and so on. I tried to export a svg file of the plot with the exportSVG
function. Thus, would be possible to use the magick
package to import and deal with different plots of such a class (i.e. "grViz" "htmlwidget"
). However, this function is not available in the newer version of the DiagrammeR
package. Any ideas to combine these plots in a figure that could be exported to a figure file such as pdf
or tiff
?