Graphics Commands and Object Properties (MATLAB) Part 2

Summary of the Axis Function – Section 4.2.2

Syntax

Affect

axis([xmin xmax ymin ymax])

Sets the x- and y-axis limits.

axis([xmin xmax ymin ymax zmin zmax cmin cmax])

Sets the x-, y-, and z-axis limits and the color scaling limits.

v = axis

Returns a row vector containing the x-, y-, and z-axis limits, i.e., scaling factors for the x-, y-, and z-axis.

axis auto

Computes the current axes’ limits automatically, based on the minimum and maximum values of x, y, and z data.

tmpb8bf-322

Computes the indicated axis limit automatically.

axis manual

Freezes scaling of the current limits. Used with hold forces subsequent plots to use the same limits.

axis tight

or

axis fill


Sets the axis limits to the range of the data.

axis ij

Sets the origin of the coordinate system to the upper left corner. The i-axis is vertical, increasing from top to bottom. The j-axis is horizontal, increasing from left to right.

axis xy

This is the default coordinate system with the origin at the lower left corner. The x-axis is horizontal increasing from left to right, and the y-axis is vertical increasing from bottom to top.

Scalar Volume Computation Functions – Section 4.3.1

Function

Action

FVC =

isocaps(X,Y,Z,V,ISOVALUE)

Computes an isosurface end cap geometry for data V at isosurface value ISOVALUE and returns a structure containing the faces, vertices, and colors of the end cap which can be passed directly to the patch function.

NC =

isocolors(X,Y,Z,C,VERTICES)

Computes the colors of isosurface vertices VERTICES using color values C and returning them in the array NC.

N =

isonormals(X,Y,Z,V,VERTICES)

Computes the normals (N) of isosurface vertices VERTICES by using the gradient of the data in V.

FV =

isosurface(X,Y,Z,V,ISOVALUE)

Extracts an isosurface at ISOVALUE in the volume V, returning the structure FV containing the faces and vertices of the isosurface, suitable for use with the patch function.

NFV = reducepatch(P,R)

Reduces the number of faces in a patch P by a fraction R of the original faces. It returns the structure NFV containing the new faces and vertices.

[NX, NY, NZ, NV] = reducevolume(X,Y,Z,V,[Rx Ry Rz])

Reduces the number of elements in a volume by only keeping every Rx, Ry, Rz element in the corresponding x, y, or z direction.

NFV = shrinkfaces(P,SF)

Reduces the size of patch P by shrink factor SF, returning a structure NFV containing the new faces and vertices.

W = smooth3(V,’gaussian’, SIZE) W = smooth3(V,’box’, SIZE)

Smooths the data in V according to the convolution kernel of size SIZE specified by the given string.

FVC = surf2patch(S)

Converts a surface object S into a patch object. FVC is a structure containing the faces, vertices, and colors of the new patch.

[NX, NY, NZ, NV] = subvolume(X,Y,Z,V,LIMITS)

Extracts a subset of volume data from V using limits LIMITS = [xmin xmax ymin ymax zmin zmax].

contou rslice(X,Y,Z,V,Sx, Sy,Sz)

Draws contours in a volume slice plane at the points in the vectors Sx, Sy, and Sz.

patch(x,y,z,C)

Creates a patch in the 3-D space of color defined by C.

slice(X,Y,Z,V,Sx,Sy,Sz)

Draws a slice plane described by the vectors Sx, Sy, Sv, through the volume V.

Graphics

Object

Low-Level Creation Function

Description

Figure

figure or figure(H)

A window to show other graphics objects.

Axes

axes, axes(H), or axes(‘position’,RECT)

The axes for showing graphs in a figure.

UIcontrol

Uicontrol

The user interface control is used to execute a function in response to the user.

UImenu

Uimenu

User defined menus in the figure.

UIcontextmenu

uicontextmenu(‘PropertyName1 ‘,value1,…)

A pop-up menu that appears when a user right-clicks on a graphics object.

Image

image(C) or image(x,y,C)

A 2-D bitmap.

Light

light(‘PropertyName’,'PropertyValue’,.)

Light sources that affect the coloring of patch and surface objects.

Line

line(x,y) or line(x,y,z)

A line in 2-D or 3-D plots.

Patch

patch(x,y,c) or patch(x,y,z,c)

A polygon that is filled with some color or texture and has edges.

Rectangle

rectangle, rectangle(‘Position’,[x,y,w,h]), or rectangle(‘Curvature’,[x,y],..)

A 2-D shape; can be rectangle or oval created within an axes object.

Surface

surface(X,Y,Z,C), surface(X,Y,Z), surface(Z,C), surface(Z)

3-D representation of data plotted as heights above the x-y plane.

Text

text(x,y,text_string) or text(x,y,z,text_string)

Character strings used in a figure.

Property

Read

Only

ValueType/Options

Format

BusyAction

No

[ {queue} | cancel ]

row

Button Down Fcn

No

string

row

Children

No*

handle(s)

column

Clipping

No

[ {on} | off ]

row

CreateFcn

No

string

row

DeleteFcn

No

string

row

HandleVisibility

No

[ {on} | callback | yes ]

row

HitTest

No

[ {on} | off ]

row

Interruptible

No

[ no | {yes} | off | {on} ]

row

Parent

No

handle

one element

Selected

No

[{off} | on ]

row

SelectionHighlight

No

[ {no} | yes | {off} | on ]

row

Tag

No

string

row

Type

Yes

string

row

UserData

No

number(s) or string

matrix

Visible

No

[ {on} | off ]

row

Property

Read

Only

Value Type/Options

Format

Display Related

zixedWidthFontName

No

string

row

ScreenDepth

Yes

integer

1 element

ScreenSize

Yes

[left bottom width height]

4-element row

Related to the State of MATLAB

CallbackObject

Yes

handle

1 element

CurrentFigure

No

handle

1 element

ErrorMessage

No

string

row

PointerLocation

No

[x-coordinate,y-coordinate]

2-element row

PointerWindow

Yes

handle

1 element

ShowHiddenHandles

Yes

[ on | {off} ]

row

Behavior Related

Diary

No

[ on | {off} ]

row

DiaryFile

No

string

row

Echo

No

[ on | {off} ]

1 element

Format

No

[ short | long | {shortE} | longE | hex | bank | + | rat ]

row

FormatSpacing

No

[ {loose} | compact ]

row

Language

No

string

row

RecursionLimit

No

integer

1 element

Units

No

[ inches | centimeters | normalized | points | {pixels} ]

row

Property

Read

Only

Value Type/Options

Format

Positioning the Figure

Position

No

[left bottom height width]

4-element row

Units

No

[ inches | centimeters | normalized | points |

row

{pixels} ]

Style & Appearance

Color

No

[Red Green Blue] or color string

RGB vector

MenuBar

No

[{figure} | none]

1 element

Name

No

string

row

NumberTitle

No

[ {on} | off ]

row

Resize

No

[ {on} | off ]

row

WindowStyle

No

[ {normal} | modal ]

row

Colormap Controls

Colormap

No

M RGB number triplets

M-by-3 matrix

Dithermap

No

N RGB number triplets

M-by-3 matrix

Dithermapmode

No

auto | {manual}]

row

FixedColors

No

N RGB number triplets

N-by-3 matrix

MinColormap

No

number

1 element

ShareColors

No

[ no | {yes} ]

row

Transparency

Alphamap

No

default is 64 values progression from 0 to 1

M-by-1 vector

Renderer

BackingStore

No

{on} | off ]

row

DoubleBuffer

No

[ on | {off} ]

row

Renderer

No

{patinters} | zbuffer | OpenGL ]

row

RendererMode

No

{auto} | manual ]

row

Current State

CurrentAxes

No

handle

1 element

CurrentCharacter

No

character

1 element

CurrentObject

No

handle

1 element

CurrentPoint

No

x-coordinate, y-coordinate]

2-element row

SelectionType

Yes

normal | extended | alt | open]

row

Property

Read

Only

Value Type/ Options

Format

Properties that Affect the Pointer

Pointer

No

crosshair | fullcrosshair | {arrow} | ibeam | watch | topl | topr | botl | botr | left | top | right | bottom | circle | cross | fleur | custom ]

string

PointerShapeHotSpot

No

(row index, column index)

2-element row

PointerShapeCData

No

1s where black, 2s where white, NaNs where transparent

16-by-16

Callback Execution

CloseRequestFcn

No

string, function handle, or cell-array ‘closereq’}

string, 1-element, cell-

KeyPressFcn

No

string

array

string

ResizeFcn

No

string

string

UIContextMenu

No

Number

1 element

WindowButtonDownFcn

WindowButtonMotionFcn

No

No

string

string

string

string

WindowButtonUpFcn

No

string

string

Controlling Access to Objects

IntegerHandle

NextPlot

No

{on} | off ]

string

string

No

{add} | replace | replacechildren ]

Properties that Affect Printing

InvertHardcopy

No

{on} | off ]

string

PaperOrientation

No

{portrait} | landscape]

string

PaperPosition

No

left bottom width height]

4-element row

PaperPositionMode

No

{auto} | manual]

string

PaperSize

No

[width height]

2-element row

PaperType

No

tmpb8bf-323

string

PaperUnits

No

{inches}|centimeters| normalized | points]

string

General

FileName

No

A name of a FIG-File to be used with GUIDE; see Chapter 10.

string

Next post:

Previous post: