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:
h = plot(x,y)There is a hierarchy of graphic objects. Some objects contain other objects. This concept is associated with parent/children objects.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
t = 0:0.1:3;
h1 = plot(t,3*exp(-0.5*t).*sin(2*t));
get(h1)
BeingDeleted
= off
ButtonDownFcn
=
Children
= []
Clipping
= on
CreateFcn
=
DeleteFcn
=
BusyAction
= queue
HandleVisibility
= on
HitTest
= on
Interruptible
= on
Parent
= [100.001]
Selected
= off
SelectionHighlight
= on
Tag
=
Type
= line
UIContextMenu
= []
UserData
= []
Visible
= on
You can also enquire
about a particular property instead of all property
get(h1,'Color')
% get the current color of the plot line
get(gcf) % get the handle of current figure
get(gca) % get the handle of the current axes