Description Usage Arguments Value Examples
Add vectors indicating the gradient field to the heatmap of the cumulated path lengths.
1 2 3 | addGGArrows(g, centers, gradients, fac = 0.025,
arrow_len = unit(0.075/2, "inches"), nColumns = 10L, nRows = 10L,
...)
|
g |
[ |
centers |
[ |
gradients |
[ |
fac |
[ |
arrow_len |
[ |
nColumns |
[ |
nRows |
[ |
... |
[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 | # 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 white arrows of the gradient field to the plot:
addGGArrows(g, points, gradients, color = "white")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.