plot

Purpose

Plot the union of convex sets.

Syntax

h = plot(U, 'Prop1', value1, 'Prop2', value2)
h = U.plot('Prop1', value1, 'Prop2', value2)
h = plot(U1, 'Prop1', value1, ..., U2, 'Prop2', value2, ...)

Description

Plot the union of general convex sets up to dimension three. Figure properties, such as color, line width, etc, can be specified with "Property" - "Value" pairs.

Input Arguments

U

Union object that contains sets derived from the ConvexSet class, e.g. Polyhedron, YSet, ...

Class: Union

Prop1

Specification of figure properties.

Class: char

Allowed values:

  • Grid

    With how many gridpoints to grid the circle/sphere for YSet objects. Default is 40.
  • Color

    The color of the plot specified by real RGB vector or a string name of the color (e.g. 'gray');
  • Wire

    Highlight or not the edges of the set. Default is false.
  • LineStyle

    Specify the type of the line to plot edges of the set. Accepted values are '-',':','-.','--', and'none'.
  • LineWidth

    Specify the width of the line. Default is 1.
  • Alpha

    Transparency of the color. The value must be inside [0,1] interval. Default is 1.
  • Marker

    Type of markings to use. Allowed values are ".", "o", "x", "+", "*", "s", "d", "v", "\^", "<", ">", "p", "h" or "none". Default is "none".
  • MarkerSize

    The size of the marker. Default is 6.
  • ColorMap

    Color map given either as a M-by-3 matrix, or as a string. Default is 'mpt'. Other available options are 'hsv', 'hot', 'gray', 'lightgray', 'bone', 'copper', 'pink', 'white', 'flag', 'lines', 'colorcube', 'vga', 'jet', 'prism', 'cool', 'autumn', 'spring', 'winter', 'summer'.
  • ColorOrder

    Either 'fixed' for fixed ordering of colors, or 'random' for a random order. Default is 'fixed'.
  • ShowIndex

    This option is valid only for bounded polyhedra in 2D. If true, display an index of the plotted element. The default choice is false.

value1

Corresponding value to Prop1.

Output Arguments

h

Handle related to graphics object.

Class: handle

Example(s)

Example 1

Plot union of two sets in 2D. We have a half circle describe the the following inequalities
 x = sdpvar(2,1); 

 F = [x(1)<=1; x(2)>=1; 0.2*x'*x <= 0.9]; 
 Construct the set 
 S = YSet(x,F); 
 Construct outer approximation of the set S 
      
 B = S.outerApprox; 
 Store the sets inside the union object 
 U = Union(S); U.add(B) 
Union of 2 convex sets.
Functions : none
Plot the sets in the Union object with the 0.4 transparency.
 U.plot('Alpha',0.4); 
Plotting...
30 of 40

../../../../../../fig/mpt/modules/geometry/unions/@Union/plot_img_1.png

See Also

fplot


© 2010-2013 Colin Neil Jones: EPF Lausanne, colin.jones@epfl.ch

© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch