TikzCode: Generate Tikz Code for Plot

View source: R/tikz.R

TikzCodeR Documentation

Generate Tikz Code for Plot

Description

Generate Tikz Code for Plot

Usage

TikzCode(
  x,
  file = "",
  z,
  n_pos,
  bend,
  ud_thresh = 0.5,
  cutoff = 0.1,
  func,
  bend_double = TRUE,
  rev = FALSE,
  col = c("black", "black", "blue", "red"),
  labels = NULL,
  nodesOnTop = TRUE,
  edgeScale = 1,
  ...
)

Arguments

x

adjacency matrix from MCMC summary

file

file to output code (defaults to stout)

z

optionally, a matrix of z-scores

n_pos

optional matrix of node positions (requires Rgraphviz if not specified)

bend

edge angles

ud_thresh

threshold for drawing edges as undirected

cutoff

threshold for including edges

func

vectorized function to transform probabilities

bend_double

bend automatically if arrows in two different directions?

rev

logical - should thickness and density plotting be reversed?

col

colours for undirected, directed and positive and negative edges

labels

character vector of labels for nodes

nodesOnTop

logical: should nodes be on top of everything else

edgeScale

scales edges to a desired width

...

other arguments

Details

If more than ud_thresh of the edges present are in a particular direction, then the two directions are drawn separately, otherwise an undirected edge is drawn. Edges present in less than cutoff sampled graphs are ignored entirely. func is a transformation that can be applied to the probability (e.g. squaring it to reduce the visual impact of weak edges). This must take a matrix and return a matrix of the transformed values.

If z is specified, then the function will plot the thickness of the line to be related to this quantity. If rev = TRUE then the thickness of the line is related to the size of the effect, and the density of colour to the proportion of samples containing that effect.

col is given as a character vector of up to four colours. The order is undirected positive and negative, followed by directed positive and negative. Colours are just repeated if necessary.

If labels is not provided these are taken from the rownames of x.


rje42/DAGtools documentation built on June 6, 2024, 3:13 a.m.