Graphics properties, MATLAB in Engineering

Graphics Properties:

The MATLAB uses the Handle Graphics in all its figures. All figures consist of various objects, each of which is assigned a handle. The object handle is a exclusive real number which is used to refer to the object.

The different plot functions return a handle for the plot object that can then be stored in a variable. The plot function plots a sin function as shown below in a Figure Window and returns a real number that is the object handle. This handle will remain valid as long as the object exists.

1001_Graphics Properties.png

  >> x = -2*pi: 1/5 : 2*pi;

     >> y = sin(x);

     >> hl = plot(x,y)

     hl =

    158.5420

Note that after getting the plot, the Figure Window must not be closed, so that it would make the object handle invalid as the object wouldn't exist anymore! The properties of that object can be exhibited using the get function. This displays properties like the LineStyle, Color, LineWidth, and so forth.

 

>> get(hl)

     Color:  [0 0 1]

   EraseMode:  'normal'

  LineStyle:  '-'

   LineWidth:  0.5000

   Marker:  'none'

   MarkerSize:  6

  MarkerEdgeColor:  'auto'

   MarkerFaceColor:  'none'

   XData:  [1x63 double]

   YData:  [1x63 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:  157.5415

   DisplayName:  ''

    XDataMode:  'manual'

  XDataSource:  ''

  YDataSource:  ''

   ZDataSource:  ''

Posted Date: 10/22/2012 2:05:01 AM | Location : United States







Related Discussions:- Graphics properties, Assignment Help, Ask Question on Graphics properties, Get Answer, Expert's Help, Graphics properties Discussions

Write discussion on Graphics properties
Your posts are moderated
Related Questions
Reading from a Mat-File: The load function is used to read from various types of files. As with save function, by default the file will be supposed to be a MAT-file, and load

Example Exit modular program: In the illustration below, the user  Chose the Limit; -   Whenever prompted for n, entered the two invalid values before finally ente

Structures: The Structures are data structures which group together values which are logically related in what are known as the fields of structure. The benefit of structures

Gauss-Jordan: The Gauss-Jordan elimination technique begins in similar way which the Gauss elimination technique does, but then rather than of back-substitution, the eliminati

Finding sums and products: A very general application of a for loop is to compute sums and products. For illustration, rather than of just printing the integers 1 through 5, w

FOR Loop: The for loop, or the for statement, is used whenever it is essential to repeat statement(s) in the script or function, and whenever it is known ahead of time how man

Illustration of Subfunctions: This is an illustration of running this program: >> rectarea Please enter the length: 6 Please enter the width: 3 For a rectan

Function fieldnames - structure functions: The function fieldnames will return the names of the fields which are contained in the structure variable. >> pack_fields = fiel

Defined a variable in work space: The variables defined in the script will become a part of the workspace: >> clear >> who >> mysummfile    15 >> who

Print from the structure: To print from the structure, a disp function will show either the whole structure or a field. >> disp(package) item_no: 123 cost: 19.99