plot.hydra: Plot a hyperbolic embedding

Description Usage Arguments Author(s) Examples

View source: R/plot.hydra.R

Description

Plot a two-dimensional hyperbolic embedding as returned by hydra in the Poincare disc

Usage

1
2
3
4
5
## S3 method for class 'hydra'
plot(x, labels = NULL, node.col = 1, pch = NULL,
  graph.adj = NULL, crop.disc = TRUE, shrink.disc = FALSE,
  disc.col = "grey90", rotation = 0, mark.center = 0,
  mark.angles = 0, mildify = 3, cex = 1, ...)

Arguments

x

a hydra object as returned by hydra with dimension dim equal 2

labels

character labels for the embedded points, supplied as a vector. NULL triggers default values

node.col

colors for the labels and/or points, supplied as a vector. NULL triggers default values. See ‘Color Specification’ in par for details

pch

plotting 'characters' for the embedded points. supplied as a vector. NULL triggers default values. See points for details

graph.adj

a graph adjacency matrix that is used to plot links between the embedded points (links are drawn for all non-zero elements of graph.adj)

crop.disc

should the Poincare disc be cropped or fully shown? Defaults to TRUE

shrink.disc

if true, the Poincare disc is shrunk to tightly fit all plotted points. Defaults to FALSE

disc.col

color of the Poincare disc. Set to "white" to hide disc

rotation

rotate points by this angle (specified in degrees) around the center of the Poincare disc

mark.center

Should a cross be placed at the center of the disc? If 0, nothing is drawn. Other values specify the relative size of the cross mark.

mark.angles

Should the angular coordinates of points be marked at the boundary of the disc? If 0, nothing is drawn. Other values specify the relative size of the angle marks.

mildify

large values reduce the curvature of links. Values around 3 are visually most appealing. Setting mildify to 1 shows the true hyperbolic curvature

cex

character expansion for labels and points, supplied as a numerical vector. See also points

...

all other parameters are passed on as additional graphical parameters (see par)

Author(s)

Martin Keller-Ressel <martin.keller-ressel@tu-dresden.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(karate)
embedding <- hydra(karate$distance)
plot(embedding,labels=karate$label,node.col=karate$group,graph.adj=karate$adjacency)

# plot points instead of labels, hide Poincare disc and rotate by 90 degrees:
plot(embedding,pch=karate$group, node.col=karate$group,graph.adj=karate$adjacency, disc.col="white",
     rotation=90)

# do not crop the Poincare disc, mark the center and mark angles:
plot(embedding,labels=karate$label, node.col=karate$group,graph.adj=karate$adjacency,
     crop.disc=FALSE, mark.center=0.05, mark.angles=0.025)

hydra documentation built on May 2, 2019, 9:25 a.m.

Related to plot.hydra in hydra...