area

Creates stacked areas in an axes and returns handles of the areas.

Syntax

h = area(x, y)

h = area(y)

h = area(... property, value, ...)

h = area(hAxes, ...)

Inputs

x,y
Range of the x and y axes.
Type: double | integer
Dimension: scalar | vector | matrix
level
Base line level of the shading (not supportted yet). The default level is 0.
Type: double | integer
Dimension: scalar
property
Properties that control the appearance or behavior of the graphics object.
Type: string
Dimension: scalar
value
Value of properties.
Type: double | integer | string
Dimension: scalar | vector
hAxes
Axis handle.
Type: double
Dimension: scalar

Outputs

h
Handle of the area graphics object.

Examples

Simple area example:

clf;
x = [1:5]
y = [x',x',x']
a = area(x,y)


Figure 1. Simple area example
Simple area example with x omitted:
clf;
y = [1:5]
area(y)


Figure 2. Area example with x omitted

Simple area example with line, value and property:

clf;
a=area([1 2 3], [1 3 2], 'facecolor', [217 151 150]);
get(a)


Figure 3. Area example with options

Comments

If there is no axes, one will be created first. If x is omitted, the index of y is used as data to associate with x axis. Area takes optional arguments to control the area style. It can be either base line level (not supported yet), or property/value pair(s), or both.