Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

replot

Edit the Layout of a Haplotype Network


Description

This function makes possible to change the layout of a haplotype network interactively or with specified coordinates.

Usage

replot(xy = NULL, col.identifier = "purple", ...)

Arguments

xy

an optional list with vectors names x and y (or xx and yy) giving the coordinates of the nodes.

col.identifier

the colour used to identify the node to be moved.

...

further arguments passed to plot.

Details

This function can be used in two ways. By default (i.e., replot()), the user can edit a plotted haplotype network by clicking with the mouse on the graphical window: a message is printed asking to click once close to the node to move and then clicking again where this node should be placed (careful: two separate single clicks). Editing is stopped with a right click.

The second possible use is to specify the new coordinates of the nodes with the argument xy, typically, from a previous call to replot (see examples).

Since pegas 1.0, these coordinates can be used directly in plot.haploNet making possible to combine networks with other graphics (which not possible with replot because the network is replotted).

Value

a named list with two numeric vertors (x and y).

Author(s)

Emmanuel Paradis

See Also

Examples

## Not run: 
data(woodmouse)
net <- haploNet(haplotype(woodmouse))
plot(net)
o <- replot() # interactive
## click to rearrange the network at will...
## then do a different plot using the same coordinates:
plot(net, bg = "red", labels = FALSE, show.mutation = 2)
replot(o) # not interactive

## End(Not run)

pegas

Population and Evolutionary Genetics Analysis System

v1.0
GPL (>= 2)
Authors
Emmanuel Paradis [aut, cre, cph] (<https://orcid.org/0000-0003-3092-2199>), Thibaut Jombart [aut, cph] (<https://orcid.org/0000-0003-2226-8692>), Zhian N. Kamvar [aut, cph] (<https://orcid.org/0000-0003-1458-7108>), Brian Knaus [aut, cph] (<https://orcid.org/0000-0003-1665-4343>), Klaus Schliep [aut, cph] (<https://orcid.org/0000-0003-2941-0161>), Alastair Potts [aut, cph] (<https://orcid.org/0000-0003-0919-7279>), David Winter [aut, cph] (<https://orcid.org/0000-0002-6165-0029>)
Initial release
2021-04-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.