plot_front | R Documentation |
Connects the points of a Pareto front (also known as Pareto frontier) and hence visualizes the dominance region of a Skyline.
plot_front(df, pref, ...)
df |
The data frame for which the Pareto front is plotted. This may be already a maximal set w.r.t. the preference |
pref |
The preference representing the Skyline goals. This must be a Pareto composition ( |
... |
Additional graphic parameters which are passed to the |
plot_front
assumes that there is an existing plot, where the value of the first preference was plotted as x-coordinate
and the value of the second preference as y-coordinate.
Note that plot_front
is only recommended if you want to use the plotting functionality from base R.
If you prefer to use ggplot2, we recommend using geom_step
for plotting the Pareto front.
See vignette("visualization", package = "rPref")
for examples.
# plots Pareto fronts for the hp/mpg values of mtcars show_front <- function(pref) { plot(mtcars$hp, mtcars$mpg) sky <- psel(mtcars, pref) plot_front(mtcars, pref, col = rgb(0, 0, 1)) points(sky$hp, sky$mpg, lwd = 3) } # do this for all four combinations of Pareto compositions show_front(low(hp) * low(mpg)) show_front(low(hp) * high(mpg)) show_front(high(hp) * low(mpg)) show_front(high(hp) * high(mpg)) # compare this to the front of a intersection preference show_front(high(hp) | high(mpg))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.