2D Graphics: Handle Graphics

MATLAB "Handle Graphics" (HG) refers to the collection of low level graphic routines that actually generate or carry out graphical changes you see in the MATLAB figure window.  For most part these routines are transparent and wrapped by higher level commands.  Knowledge of HG is further made unnecessary by the ability to edit the figure through plot editing commands.  There are at least three reasons why you need to know about them as far as these pages are concerned:

Handle Graphic functions operate through Handles.  All graphic objects in MATLAB are identified by a unique number called a handle. In order to get and set properties of objects it is necessary to know their handle. So it is a good idea to associate a handle with a graphic object.  For example
h = plot(x,y)

will create a plot of y versus x in a figure window with an axis and will return a value for the handle for the plot (line) that will be stored in variable h.  All objects will have default properties.  We can then change the appearance of the plot through this handle variable.  For example

set(h,'Color','r');

will cause the plot to be drawn in red color. All object properties are typically specified as a pair

('PropertyName',Value)
PropertyName is usually a string. Value is an appropriate quantity - string, number,array
There is a hierarchy of graphic objects. Some objects contain other objects.  This concept is associated with parent/children objects.
There are two important functions: There are two important functions that return the handle of the current figure and axes
get(gcf)     % get the handle of current figure
get(gca)    % get the handle of the current axes