Sometimes may be useful to see where is the nearest neighbor graphically. This is the reasoning behind, for example, FLUSS which uses the arc count to infer a semantic change, and SiMPle which infer that arcs connect similar segments of a music. See details for a deeper explanation how to use this function.

plot_arcs(
  pairs,
  alpha = NULL,
  quality = 30,
  lwd = 15,
  col = c("blue", "orange"),
  main = "Arc Plot",
  ylab = "",
  xlab = "Profile Index",
  xmin = NULL,
  xmax = NULL,
  ...
)

Arguments

pairs

a matrix with 2 columns.

alpha

a numeric. (Default is NULL, automatic). Alpha value for lines transparency.

quality

an int. (Default is 30). Number of segments to draw the arc. Bigger value, harder to render.

lwd

an int. (Default is 15). Line width.

col

a vector of colors. (Default is c("blue", "orange")). Colors for right and left arc, respectively. Accepts one color.

main

a string. (Default is "Arc Plot"). Main title.

ylab

a string. (Default is ""). Y label.

xlab

a string. (Default is "Profile Index"). X label.

xmin

an int. (Default is NULL). Set the minimum value of x axis.

xmax

an int. (Default is NULL). Set the maximum value of x axis.

...

further arguments to be passed to plot(). See par().

Value

None

Details

You have two options to use this function. First you can provide just the data, and the function will try its best to retrieve the pairs for plotting. Second, you can skip the first parameters and just provide the pairs, which is a matrix with two columns; the first is the starting index, the second is the end index. Two colors are used to allow you to identify the direction of the arc. If you use the rpi or lpi as input, you will see that these profile indexes have just one direction.

exclusion_zone is used to filter out small arcs that may be useless (e.g. you may be interested in similarities that are far away). edge_limit is used to filter out spurious arcs that are used connect the beginning and the end of the profile (e.g. silent audio). threshold is used to filter indexes that have distant nearest neighbor (e.g. retrieve only the best motifs).

Examples

plot_arcs(pairs = matrix(c(5, 10, 1, 10, 20, 5), ncol = 2, byrow = TRUE))