View source: R/4.3_Mix_designs_Functions.R
contourPlot3 | R Documentation |
This function creates a ternary plot (contour plot) for mixture designs (i.e. object of class mixDesign
).
contourPlot3(
x,
y,
z,
response,
data = NULL,
main,
xlab,
ylab,
zlab,
form = "linear",
col = 1,
col.text,
axes = TRUE,
steps,
plot = TRUE,
show.scale = TRUE
)
x |
Factor 1 of the |
y |
Factor 2 of the |
z |
Factor 3 of the |
response |
the response of the |
data |
The |
main |
Character string specifying the main title of the plot. |
xlab |
Character string specifying the label for the x-axis. |
ylab |
Character string specifying the label for the y-axis. |
zlab |
Character string specifying the label for the z-axis. |
form |
A character string or a formula with the syntax 'y ~ A + B + C'. If form is a character string, it has to be one of the following:
How the form influences the output is described in the reference listed below.
By default, |
col |
A predefined value (1, 2, 3, or 4) or a self-defined |
col.text |
A character string specifying the color of the axis labels.
The default value |
axes |
A logical value specifying whether the axes should be plotted.
By default, |
steps |
A numeric value specifying the resolution of the plot, i.e., the number of rows for the square matrix, which also represents the number of grid points per factor.
By default, |
plot |
Logical value indicating whether to display the plot. Default is |
show.scale |
Logical value indicating whether to display the color scale on the plot. Default is |
The function contourPlot3
returns an invisible list containing:
mat - A matrix containing the response values as NA's and numerics.
plot - The generated plot.
mixDesign.c
, mixDesign
, wirePlot3
.
mdo = mixDesign(3,2, center = FALSE, axial = FALSE, randomize = FALSE,
replicates = c(1,1,2,3))
mdo$names(c("polyethylene", "polystyrene", "polypropylene"))
mdo$units("percent")
elongation = c(11.0, 12.4, 15.0, 14.8, 16.1, 17.7, 16.4, 16.6, 8.8, 10.0, 10.0,
9.7, 11.8, 16.8, 16.0)
mdo$.response(elongation)
contourPlot3(A, B, C, elongation, data = mdo, form = "linear")
contourPlot3(A, B, C, elongation, data = mdo, form = "quadratic", col = 2)
contourPlot3(A, B, C, elongation, data = mdo,
form = "elongation ~ I(A^2) - B:A + I(C^2)",
col = 3, axes = FALSE)
contourPlot3(A, B, C, elongation, data = mdo,
form = "quadratic",
col = c("yellow", "white", "red"),
axes = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.