plotEqn3d | R Documentation |
Shows what matrices A, b
look like as the system of linear equations, A x = b
with three unknowns,
x1, x2, and x3, by plotting a plane for each equation.
plotEqn3d(
A,
b,
vars,
xlim = c(-2, 2),
ylim = c(-2, 2),
zlim,
col = 2:(nrow(A) + 1),
alpha = 0.9,
labels = FALSE,
solution = TRUE,
axes = TRUE,
lit = FALSE
)
A |
either the matrix of coefficients of a system of linear equations, or the matrix |
b |
if supplied, the vector of constants on the right hand side of the equations, of length matching
the number of rows of |
vars |
a numeric or character vector of names of the variables.
If supplied, the length must be equal to the number of unknowns in the equations.
The default is |
xlim |
axis limits for the first variable |
ylim |
axis limits for the second variable |
zlim |
horizontal axis limits for the second variable; if missing, |
col |
scalar or vector of colors for the lines, recycled as necessary |
alpha |
transparency applied to each plane |
labels |
logical, or a vector of character labels for the equations; not yet implemented. |
solution |
logical; should the solution point for all equations be marked (if possible) |
axes |
logical; whether to frame the plot with coordinate axes |
lit |
logical, specifying if lighting calculation should take place on geometry; see |
nothing; used for the side effect of making a plot
Michael Friendly, John Fox
Fox, J. and Friendly, M. (2016). "Visualizing Simultaneous Linear Equations, Geometric Vectors, and Least-Squares Regression with the matlib Package for R". useR Conference, Stanford, CA, June 27 - June 30, 2016.
# three consistent equations in three unknowns
A <- matrix(c(13, -4, 2, -4, 11, -2, 2, -2, 8), 3,3)
b <- c(1,2,4)
plotEqn3d(A,b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.