Learning notes for Matlab (8) handle graphics

Source: Internet
Author: User
Handle graphics: refers to a system of graphical objects that execute functions for graphics and Visualization in MATLAB. each system is composed of a series of attributes. you can use these attributes to control the behavior and display results. i. Handle

When MATLAB constructs a graphic object, it will specify a identifier (handle) for the object. You can use this handle to obtain the graphic attributes through the set and get functions. For example, the following statement returns a line handle for a graph with h:

X =;
Y = x. ^ 3;
H = plot (x, y );

You can use the handle to set the attributes of this object. For example, you can set the color attributes of this object:

Set (H, 'color', 'red ')

Of course, you can also set its attributes when calling the plotting function, such:

H = plot (X, Y, 'color', 'red ');

When you query the linear attributes, such:

Get (H, 'linewidth ')

MATLAB returns one:

Ans =
0.5000

You can use the handle to view all the attributes of the object:

Get (h)

Shown as follows:

Color: [1 0 0]
Erasemode: 'normal'
Linestyle :'-'
Linewidth: 0.5000
Marker: 'none'
Markersize: 6
Markeredgecolor: 'auto'
Markerfacecolor: 'none'
Xdata: [1x10 double]
Ydata: [1x10 double]
Zdata: [1x0 double]
Beingdeleted: 'off'
Buttondownfcn: []
Children: [0x1 double]
Clipping: 'on'
Createfcn: []
Deletefcn: []
Busyaction: 'queue'
Handlevisibility: 'on'
Hittest: 'on'
Interruptible: 'on'
Selected: 'off'
Selectionhighlight: 'on'
Tag :''
Type: 'line'
Uicontextmenu: []
Userdata: []
Visible: 'on'
Parent: 151.0012
Displayname :''
Xdatamode: 'manual'
Xdatasource :''
Ydatasource :''
Zdatasource :''

Ii. graphic objects

A graphical object is the most basic unit used to display graphics and user interface components. These objects are organized by hierarchies as follows:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.