plot

Purpose

Plot the polyhedron.

Syntax

h = plot(P, 'Prop1', value1, 'Prop2', value2)
h = plot(P1, 'Prop1', value1, P2, 'Prop2', value2)
h = P.plot('Prop1', value1, 'Prop2', value2)

Description

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

Input Arguments

Polyhedron

Polyhedron in any object with the dimension less or equal than 3.

Class: ConvexSet

Prop1

Specification of figure properties.

Class: char

Allowed values:

  • 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'.

value1

Corresponding value to Prop1.

Output Arguments

h

Handle related to graphics object.

Class: handle

Example(s)

Example 1

Plot two polyhedra. The first polyhedron is an interval [-1, 1] in 1D.
 P(1) = Polyhedron('lb',-1,'ub',1)
Polyhedron in R^1 with representations:
    H-rep (redundant)   : Inequalities   2 | Equalities   0
    V-rep               : Unknown (call computeVRep() to compute)
Functions : none
The second polyhedron is in H-representation.
 P(2) = Polyhedron('A',[0 -1;0.4 4;0.5 -2.1],'b',[1;2;3]) 
Array of 2 polyhedra.
Plot the sets with the dash-dotted line and the size 3.
 P.plot('LineStyle','-.','LineWidth',3); 

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

Example 2

Generate lower-dimensional polyhedron in 3D
 P = ExamplePoly.randHrep('d',3,'ne',1); 
 Plot the polyhedron in 'darkred' color and some alpha transparency
 P.plot('Color','darkred','Alpha',0.6); 

../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/plot_img_2.png

Example 3

Plot two polyhedra with different properties.
 P1 = ExamplePoly.randVrep; 

 P2 = rand(2)*P1+rand(2,1); 
 Plot the polyhedron P1 in lightgreen, dashed style and P2 in wired frame and return handles.
 h = plot(P1,'color','lightgreen','linestyle','--',P2,'wire',true); 

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

© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk