ellipsoid_3d: Draw an labeled custom ellipsoid

Description Usage Arguments See Also Examples

View source: R/rgl_group_representation.R

Description

Compute and draw a labeled ellipsoid in a rgl device.

Usage

1
2
3
4
5
6
ellipsoid_3d(x, y, z, color = "black", type = "wire and shade",
  level = 0.95, label = "", wire_color = NULL, wire_alpha = 0.2,
  wire_lit = FALSE, shade_color = NULL, shade_alpha = 0.1,
  shade_lit = FALSE, 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.

type

Character, representing the type of ellipsoid filling: "wire", "shade" or "wire and shade" (wire3d, shade3d).

level

Numeric, the confidence level of a simultaneous confidence region (ellipse3d).

label

Character, The ellipsoid label.

wire_color, shade_color, label_color

The specific colors to be used in the ellipsoid's elements. If not NULL, they override the color argument.

wire_alpha, wire_lit

Numeric, the wire alpha and lit parameters (rgl.material).

shade_alpha, shade_lit

Numeric, the shade alpha and lit parameters (rgl.material).

label_cex, label_family, label_font, label_adj, label_alpha

The group labels text parameters (text3d, rgl.material).

See Also

ellipsoid_3d, rgl_init, ellipse3d, wire3d, shade3d, 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.75)

# 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"))

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

# Add ellipsoid
ellipsoid_3d(setosa[, 1], setosa[, 2], setosa[, 3], label = "setosa",
            wire_color = "green", shade_color = "red",
            label_color = "blue", label_adj = c(-1, 0.5))

remove(setosa)


## End(Not run)

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