28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2hggroup<br />

Purpose Create hggroup object<br />

Syntax h = hggroup<br />

h = hggroup(...,'PropertyName',propertyvalue)<br />

hggroup<br />

Description An hggroup object can be the parent of any axes children, including other<br />

hggroup objects. You can use hggroup objects to form a group of objects that can<br />

be treated as a single object with respect to the following cases:<br />

Visible — Setting the hggroup object’s Visible property also sets each child<br />

object’s Visible property to the same value.<br />

Selectable — Setting each hggroup child object’s HitTest property to off<br />

enables you to select all children by clicking any child object.<br />

Current object — Setting each hggroup child object’s HitTest property to off<br />

enables the hggroup object to become the current object when any child<br />

object is picked. See the next section for an example.<br />

Examples This example defines a callback for the ButtonDownFcn property of an hggroup<br />

object. In order for the hggroup to receive the mouse button down event that<br />

executes the ButtonDownFcn callback, the HitTest properties of all the line<br />

objects must be set to off. The event is then passed up the hierarchy to the<br />

hggroup.<br />

The following function creates a random set of lines that are parented to an<br />

hggroup object. The subfunction set_lines defines a callback that executes<br />

when the mouse button is pressed over any of the lines. The callback simply<br />

increases the widths of all the lines by 1 with each button press.<br />

Note If you are using the MATLAB help browser, you can run this example<br />

or open it in the MATLAB editor.<br />

function doc_hggroup<br />

hg = hggroup('ButtonDownFcn',@set_lines);<br />

hl = line(randn(5),randn(5),'HitTest','off','Parent',hg);<br />

function set_lines(cb,eventdata)<br />

hl = get(cb,'Children');% cb is handle of hggroup object<br />

2-1065

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!