Getting Started    

Graphics Objects

Graphics objects are the basic elements used to display graphics and user interface elements. This table lists the graphics objects.

Object
Description  
Root
Top of the hierarchy corresponding to the computer screen
Figure
Window used to display graphics and user interfaces
Axes
Axes for displaying graphs in a figure
Uicontrol
User interface control that executes a function in response to user interaction
Uimenu
User-defined figure window menu
Uicontextmenu
Pop-up menu invoked by right clicking on a graphics object
Image
Two-dimensional pixel-based picture
Light
Light sources that affect the coloring of patch and surface objects
Line
Line used by functions such as plot, plot3, semilogx
Patch
Filled polygon with edges
Rectangle
Two-dimensional shape varying from rectangles to ovals
Surface
Three-dimensional representation of matrix data created by plotting the value of the data as heights above the x-y plane
Text
Character string

Object Hierarchy

The objects are organized in a tree structured hierarchy reflecting their interdependence. For example, line objects require axes objects as a frame of reference. In turn, axes objects exist only within figure objects. This diagram illustrates the tree structure.

Creating Objects

Each object has an associated function that creates the object. These functions have the same name as the objects they create. For example, the text function creates text objects, the figure function creates figure objects, and so on. MATLAB high-level graphics functions (like plot and surf) call the appropriate low-level function to draw their respective graphics. For more information about an object and a description of its properties, see the reference page for the object's creation function. Object creation functions have the same name as the object. For example, the object creation function for axes objects is called axes.

Commands for Working with Objects

This table lists commands commonly used when working with objects.

Function
Purpose
copyobj
Copy graphics object
delete
Delete an object
findobj
Find the handle of objects having specified property values
gca
Return the handle of the current axes
gcf
Return the handle of the current figure
gco
Return the handle of the current object
get
Query the value of an objects properties
set
Set the value of an objects properties


  Handle Graphics Setting Object Properties