Plot the polytope (bounded convex set) of a linear mathematical program
Source:R/plot.R
plotPolytope2D.RdPlot the polytope (bounded convex set) of a linear mathematical program
Arguments
- A
The constraint matrix.
- b
Right hand side.
- obj
A vector with objective coefficients.
- type
A character vector of same length as number of variables. If entry k is 'i' variable \(k\) must be integer and if 'c' continuous.
- nonneg
A boolean vector of same length as number of variables. If entry k is TRUE then variable k must be non-negative.
- crit
Either max or min (only used if add the iso-profit line)
- faces
A character vector of same length as number of variables. If entry k is 'i' variable \(k\) must be integer and if 'c' continuous. Useful if e.g. want to show the linear relaxation of an IP.
- plotFaces
If
Truethen plot the faces.- plotFeasible
If
Truethen plot the feasible points/segments (relevant for ILP/MILP).- plotOptimum
Show the optimum corner solution point (if alternative solutions only one is shown) and add the iso-profit line.
- latex
If
Truemake latex math labels for TikZ.- labels
If
NULLdon't add any labels. If 'n' no labels but show the points. If equalcoordadd coordinates to the points. Otherwise number all points from one.- ...
Further arguments passed on the the
ggplotplotting functions. This must be done as lists. Currently the following arguments are supported:argsFaces: A list of arguments forplotHull2D.argsFeasible: A list of arguments forggplotl2functions:geom_point: A list of arguments forggplot2::geom_point.geom_line: A list of arguments forggplot2::geom_line.
argsLabels: A list of arguments forggplotl2functions:geom_text: A list of arguments forggplot2::geom_text.
argsOptimum:geom_point: A list of arguments forggplot2::geom_point.geom_abline: A list of arguments forggplot2::geom_abline.geom_label: A list of arguments forggplot2::geom_label.
argsTheme: A list of arguments forggplot2::theme.
Note
In general use plotPolytope() instead of this function. The feasible region defined by the constraints must be bounded otherwise you may see
strange results.
See also
plotPolytope() for examples.
Author
Lars Relund lars@relund.dk