star_3d: Draw star

Description Usage Arguments See Also Examples

View source: R/rgl_group_representation.R

Description

Compute and draw a star (centroid with links) in a rgl device.

Usage

1
2
3
4
5
star_3d(x, y, z, color = "black", label = "", centroid_color = NULL,
  centroid_radius = 0.05, centroid_alpha = 0.5, link_color = NULL,
  link_width = 1, link_alpha = 1, label_color = NULL, label_cex = 2,
  label_family = "sans", label_font = 2, label_adj = c(-0.25, 0.5),
  label_alpha = 1)

Arguments

x, y, z

Numeric vectors representing point coordinates.

color

The default color to be used in all elements.

label

The label placed at the centroid of the distribution.

centroid_color

The color of centroid point of the distribution.

centroid_radius

Numeric, the radius of the sphere used to represent the centroid of the distribution (spheres3d).

centroid_alpha

Numeric, the centroids alpha (rgl.material).

link_color

The color of the links connecting centroid and points.

link_width, link_alpha

Numeric, the link width and alpha parameters (segments3d, rgl.material).

label_color

The color of the centroid label.

label_cex, label_family, label_font, label_adj, label_alpha

The text parameters and the alpha of the centroid label (text3d, rgl.material).

See Also

stars_3d, rgl_init, spheres3d, segments3d, texts3d

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 

# Use iris data
data("iris")

# get setosa
setosa <- iris[iris$Species == "setosa",]

# Initializes the rgl device
rgl_init(zoom = 0.8)

# add axes and bounding box
rgl_format(setosa$Sepal.Length, setosa$Sepal.Width, setosa$Petal.Length,
           axes_titles = c("Sepal length", "Sepal width", "Petal length"),
           show_planes = c("XZ", "XY", "YZ"))

# Add data points
points3d(setosa[, 1], setosa[, 2], setosa[, 3], color = "black")

# Add star
star_3d(setosa[, 1], setosa[, 2], setosa[, 3], label = "setosa",
       centroid_color = "green", link_color = "red", label_color = "blue")

remove(setosa)


## End(Not run)

Andros-Spica/biplot2d3d documentation built on June 10, 2020, 1:38 p.m.