Generate tikz code to draw the staged tree or CEG graph.
write_tikz(
x,
layout = NULL,
file = "",
col = NULL,
ignore = x$name_unobserved,
node_label = function(node) {
ifelse(is.na(node$stage), "", node$stage)
},
edge_label = function(edge) {
ifelse(is.na(edge$label), "", edge$label)
},
edge_label_options = function(edge) {
return("sloped")
},
scale = 10,
normalize_layout = TRUE,
node_shape = "circle",
node_inner_sep = "1mm",
node_minimum_size = "0.3cm",
node_draw_color = "black",
node_thickness = "very thick",
node_text_color = "black"
)# S3 method for sevt
write_tikz(
x,
layout = NULL,
file = "",
col = NULL,
ignore = x$name_unobserved,
node_label = function(node) {
ifelse(is.na(node$stage), "", node$stage)
},
edge_label = function(edge) {
ifelse(is.na(edge$label), "", edge$label)
},
edge_label_options = function(edge) {
return("sloped")
},
scale = 10,
normalize_layout = TRUE,
node_shape = "circle",
node_inner_sep = "1mm",
node_minimum_size = "0.3cm",
node_draw_color = "black",
node_thickness = "very thick",
node_text_color = "black"
)
an object of class sevt
or ceg
.
the layout of the graph, given as matrix with two columns and as many rows as nodes in the staged tree. By default, a modified sugiyama layout is used. The layout matrix can be obtained with igraph layout functions.
A connection or a character string naming the file to print to.
Passed to cat
.
color specifications for the stages of the staged even tree.
Same as plot.sevt
and make_stages_col
.
vector of stages which will be ignored and not plotted,
by default the name of the unobserved stages stored in x$name_unobserved
.
a function that produces nodes labels.
a function that produces edge labels.
a function that produces edge label options.
for the tikzfigure.
a logical value. If TRUE
layout positions are scaled to the [0,1]
interval.
the shape to be used for nodes.
the inner sep
parameter.
the minimum size
parameter for the nodes.
the color for line drawing the nodes.
the thickness of the lines.
the color for label in nodes.
This function can be used to create a working
tikz code that compile to a graph similar to the
one obtained by plot.sevt(x, ...)
or
plot.ceg(x, ...)
.
Code partially inspired by the code in Exporting graphs to LaTeX, using igraph and TikZ http://igraph.wikidot.com/r-recipes#toc2