plot

Purpose

Plot the convex set.

Syntax

h = plot(Set, 'Prop1', value1, 'Prop2', value2)
h = Set.plot('Prop1', value1, 'Prop2', value2)

Description

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

Input Arguments

Set

Any object derived from the ConvexSet class, e.g. Polyhedron, YSet, ...

Class: ConvexSet

Prop1

Specification of figure properties.

Class: char

Allowed values:

  • Grid

    With how many gridpoints to grid the circle/sphere. 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 two sets in 1D. The first set is an interval [0, 3]
 x = sdpvar(1); 

 F1 = [ 0<= x <=3 ]; 

 Y1 = YSet(x,F1); 
 The second set is an intersection of two sets. 
 F2 = [x <= 1; 0.3*x^2 <= 0.5]; 

 Y2 = YSet(x,F2); 
 Put the sets to an array. 
 Y = [Y1; Y2]; 
 Plot the sets with the dash-dotted line and the size 3. 
 Y.plot('LineStyle','-.','LineWidth',3); 

../../../../../../fig/mpt/modules/geometry/sets/@ConvexSet/plot_img_1.png

Example 2

We have a half circle describe the the following inequalities
 x = sdpvar(2,1); 

 F = [x(1) <=1; x(2)>=1; 0.3*x'*x <= 0.5]; 
 Construct the set 
 S = YSet(x,F); 
 Plot the set with with the olive color, half-transparent with circular markings. 
 S.plot('Color','olive','Alpha',0.5,'Marker','o'); 
Plotting...
27 of 40

../../../../../../fig/mpt/modules/geometry/sets/@ConvexSet/plot_img_2.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