Description Usage Arguments Value Examples
Add contour lines of the separate objectives to the heatmap of the cumulated path lengths.
1 2 3 | addGGContour(g, lower, upper, fn1, fn2, fn3, log.scale = TRUE,
col1 = "goldenrod1", col2 = "white", col3 = "cyan3",
n.points = 30L, ...)
|
g |
[ |
lower |
[ |
upper |
[ |
fn1 |
[ |
fn2 |
[ |
fn3 |
[ |
log.scale |
[ |
col1 |
[ |
col2 |
[ |
col3 |
[ |
n.points |
[ |
... |
[any] |
[ggplot
]
A ggplot
object displaying the multi-objective gradient landscape.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Define two single-objective test problems and a grid of points:
fn1 = function(x) sum((x - c(0.2, 1))^2)
fn2 = function(x) sum((x - c(0.5, 0.5))^2)
points = as.matrix(expand.grid(x1 = seq(0, 0.7, 0.005), x2 = seq(0, 1.25, 0.005)))
# Compute the corresponding gradients and the cumulated path lengths:
gradients = computeGradientField(points, fn1, fn2)
x = computeCumulatedPathLengths(points, gradients)
# Visualize the resulting multi-objective "landscape":
g = ggplotHeatmap(x)
g
# Add dashed contour lines to the plot:
addGGContour(g = g, lower = c(0, 0), upper = c(0.7, 1.25),
fn1 = fn1, fn2 = fn2, linetype = "dashed")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.