Graphics Previous page   Next Page

Example -- Creating Core Graphics Objects

Object creation functions have a syntax of the form

You can specify a value for any object property (except those that are read only) by passing property name/value pairs as arguments. The function returns the handle of the object it creates, which you can use to query and modify properties after creating the object.

This example evaluates a mathematical function and creates three graphics objects using the property values specified as arguments to the figure, axes, and surface commands. MATLAB uses default values for all other properties.

Note that the surface function does not use a 3-D view like the high-level surf functions. Object creation functions simply add new objects to the current axes without changing axes properties, except the Children property, which now includes the new object and the axis limits (XLim, YLim, and ZLim), if necessary.

You can change the view using the camera commands or use the view command.


Previous page  Core Graphics Objects Parenting Next page

© 1994-2005 The MathWorks, Inc.