Learn R Programming

Rknots (version 1.3.0)

plotDiagram: Plot a knot or a link diagram

Description

Plot a knot or a link diagram, along with component orientation.

Usage

plotDiagram(points3D, ends, pca = FALSE, size = 1, colors = c(), return.vars=FALSE, ...)

Arguments

points3D
an $N$ x 3 matrix of the $x$, $y$, $z$ coordinates of a polygonal link
ends
a vector of positive integers defining the separators of the polygonal link
pca
logical, if TRUE a Principal Component Analysis is applied to rotate the points. Generally, results in a diagram simpler to be interpreted. This is especially true for large structures.
size
a scaling factor $s$ of the plot region to be used for the plot. Default 1. The plot region within the active plot window is defined by $$\frac{min(\Delta X, \Delta Y)}{s}$$. Values of $s > 1$ reduce the plot region.
colors
a vector of colors, one for each component. If not supplied, integers from 1 to $n$ are used, where $n$ is the number of link components
return.vars
logical, if TRUE returns the extended structure described in details.
...
other graphical parameters for plot.

Value

  • Called for its effect. If return.vars is TRUE, it returns a list with the following elements
  • points3Dan ($N+2k$) x 3 matrix of the $x$, $y$, $z$ coordinates of the extended polygonal link, where $k$ is the number of crossings
  • endsa vector of positive integers defining the separators of the extended polygonal link
  • undercrossa vector of positive integers defining the row in points3D containing the coordinates of the undercrossings
  • overcrossa vector of positive integers defining the row in points3D containing the coordinates of the overcrossings
  • componenta vector of positive integers of length $N+2k$ where each entry $i$ corresponds to the component the $i$-th row of points3D.

Details

Internally,this function localizes the crossings and insert auxiliary points in proximity of each undercross. The resulting extended structure can be accessed using return.vars=TRUE. The use of the parameter lwd is recommended in order to increase the line width of the overcrossings. This can be particularly useful when large structures are represented. See the examples below.

References

Weisstein, Eric W. "Knot diagram." From MathWorld--A Wolfram Web Resource, http://mathworld.wolfram.com/KnotDiagram.html

See Also

plotKnot3D

Examples

Run this code
##Represent 12 randomly selected link diagrams
par(mfrow = c(3,4))

for(i in 1 : 12) {
	link <- makeExampleKnot( k = FALSE )
	link <- AlexanderBriggs(link$points3D, link$ends)
	plotDiagram(link$points3D, link$ends, main = i, lwd = 1.5)
}

Run the code above in your browser using DataLab