maketikz {causalDisco} R Documentation

## Generate Latex tikz code for plotting a temporal DAG or PDAG.

### Description

Generate Latex tikz code for plotting a temporal DAG or PDAG.

### Usage

maketikz(
model,
xjit = 2,
yjit = 2,
markperiods = TRUE,
xpgap = 4,
annotateEdges = NULL,
varLabels = NULL,
periodLabels = NULL,
annotationLabels = NULL,
clipboard = TRUE,
colorAnnotate = NULL
)

### Arguments

 model tpdag or tamat object to plot. xjit How much should nodes within a period be jittered horizontally. yjit Vertical distance between nodes within a period. markperiods If TRUE, gray boxes are drawn behind each period. xpgap Horizontal gap between different periods. annotateEdges If TRUE, add a text annotation to edges. If annotationlabels are supplied, these labels will be used. Otherwise, the value in the inputted adjacency matrix corresponding to the edge will be used. addAxis If TRUE, a horizontal axis with period labels are added. varLabels Optional labels for nodes (variables). Should be given as a named list, where the name is the variable name, and the entry is the label, e.g. list(vname = "Label for vname"). periodLabels Optional labels for periods. Should be given as a named list, where the name is the period name (as stored in the tamat), and the entry is the label, e.g. list(periodname = "Label for period"). annotationLabels Optional labels for edge annotations. Only used if annotateEdges = TRUE. Should be given as a named list, where the name is the edge annotation (as stored in the tamat), and the entry is the label, e.g. list(h = "High"). clipboard If TRUE, the tikz code is not printed, but instead copied to the clipboard, so it can easily be pasted into a Latex document. colorAnnotate Named list of colors to use to mark edge annotations instead of labels. This overrules annotateEdges and both are not available at the same time. The list should be given with annotations as names and colors as entries, e.g. list(h = "blue").

### Details

Note that it is necessary to read in relevant tikz libraries in the Latex preamble. The relevant lines of code are (depending a bit on parameter settings):
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri}
\usepackage{pgfplots}

### Value

Silently returns a character vector with lines of tikz code. The function furthermore has a side-effect. If clipboard = TRUE, the side-effect is that the tikz code is also copied to the clipboard. If clipboard = FALSE, the tikz code is instead printed in the console.

[Package causalDisco version 0.9.1 Index]