Graphics Previous page   Next Page

Plot Objects

A number of high-level plotting functions create plot objects. The properties of plot objects provide easy access to the important properties of the core graphics objects that the plot objects contain.

Plot object parents can be axes or group objects (hggroup or hgtransform). See Objects That Can Contain Other Objects for examples.

This table lists the plot objects and the graphing functions that use them. Click object names to see a description of their properties.

Plot Objects
Used to create area graphs
Used to create bar graphs
Used to create contour graphs
Used to create errorbar graphs
Used by line plotting functions (plot, plot3, etc.)
Used to create quiver and quiver3 graphs
Used to create scatter and scatter3 graphs
Used to create stairstep graphs (stairs)
Used to create stem and stem3 graphs
Used by the surf and mesh group of functions

Creating a Plot Object

For example, the following statements create a contour graph of the peaks function and then set the line style and width of the contour lines.

The contour plot object enables you to set the line width and style of the contour graph by setting two properties. Looking at the core objects contained in the contour plot object reveals a number of patch objects whose edges are used to implement the contour line, which you would otherwise need to set individually.

Identifying Plot Objects Programmatically

Plot objects all return hggroup as the value of the Type property. If you want to be able to identify plot objects programmatically but do not have access to the object's handle, set a value for the object's Tag property.

For example, the following statements create a bar graph with five barseries objects and assign a different value for the Tag property on each object.

Note that the cell array of property values must be transposed (') to have the proper shape. See the set function for more information on setting properties.

No User Default Values

Note that you cannot define default values for plot objects.

Previous page  Simplified Calling Syntax Linking Graphs to Variables -- Data Source Properties Next page

© 1994-2005 The MathWorks, Inc.