plotDiagram: Plot a knot or a link diagram

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/plotKnotDiagram.R

Description

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

Usage

1
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(Δ X, Δ 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.

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.

Value

Called for its effect. If return.vars is TRUE, it returns a list with the following elements

points3D

an (N+2k) x 3 matrix of the x, y, z coordinates of the extended polygonal link, where k is the number of crossings

ends

a vector of positive integers defining the separators of the extended polygonal link

undercross

a vector of positive integers defining the row in points3D containing the coordinates of the undercrossings

overcross

a vector of positive integers defining the row in points3D containing the coordinates of the overcrossings

component

a vector of positive integers of length N+2k where each entry i corresponds to the component the i-th row of points3D.

Note

This is a low-level function.

Author(s)

Maurizio Rinaldi, maurizio.rinaldi@pharm.unipmn.it Federico Comoglio, federico.comoglio@bsse.ethz.ch

References

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

See Also

plotKnot3D

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
##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)
}

## End(Not run)

FedericoComoglio/Rknots documentation built on May 6, 2019, 4:35 p.m.