# boundaryline

Draw boundary line plot

## Syntax

``boundaryline(x,y)``
``boundaryline(x,y,LineSpec)``
``boundaryline(___,Name,Value)``
``boundaryline(ax, ___)``
``bline = boundaryline(___)``

## Description

### Use Default Boundary and Line Specification

example

````boundaryline(x,y)` plots a boundary line specified by the x data `x` and the y data y. The boundary line contains hatch marks that extend from a fixed spacing and length along the boundary line.`boundaryline(x,y,LineSpec)` plots a boundary line specified by the line specification `linespec`. ```

### Specify Name,Value Arguments and Axis

example

````boundaryline(___,Name,Value)` plots a boundary line specified by one or more `Name,Value` pairs. Adjust the look of the boundary line with the `'Hatches'`, `'HatchLength'`, `'HatchTangency'`, `'HatchAngle'`, `'HatchSpacing'`, and `'FlipBoundary'` properties. Specify name-value pair arguments after all other input arguments. `boundaryline(ax, ___)` plots a boundary line on the specified axes `ax` instead of the current axes, such as that from the `gca` function. ```

### Return Boundary Line Object

example

````bline = boundaryline(___)` returns a boundary line object using any of the input argument combinations in the previous syntaxes. Specify arguments as previously listed. ```

## Examples

collapse all

Plot the boundary line of a sine wave.

```x = linspace(0,2*pi); y = sin(x); boundaryline(x,y) ```
```b = BoundaryLine with properties: Color: [0 0 0] LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerFaceColor: 'none' MarkerSize: 6 HatchSpacing: 0.1000 HatchLength: 0.0300 HatchAngle: 225 Hatches: '/' HatchTangency: on FlipBoundary: off XData: [1×100 double] YData: [1×100 double] Show all properties ```

Plot a boundary line with third-spaced hatches. Return the boundary line object in b.

`b = boundaryline([0,1],[0,1],'Hatches','//')`
```b = BoundaryLine with properties: Color: [0 0 0] LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerFaceColor: 'none' MarkerSize: 6 HatchSpacing: 0.1000 HatchLength: 0.0300 HatchAngle: 225 Hatches: '//' HatchTangency: on FlipBoundary: off XData: [0 1] YData: [0 1] Show all properties```

Plot a circle boundary line and flip the boundary after creation. Return the boundary line object in b.

```t = linspace(0, 2*pi); x = cos(t); y = sin(t); b = boundaryline(x,y) b.FlipBoundary = true```
```b = BoundaryLine with properties: Color: [0 0 0] LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerFaceColor: 'none' MarkerSize: 6 HatchSpacing: 0.1000 HatchLength: 0.0300 HatchAngle: 225 Hatches: '/' HatchTangency: on FlipBoundary: off XData: [1×100 double] YData: [1×100 double] Show all properties = BoundaryLine with properties: Color: [0 0 0] LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerFaceColor: 'none' MarkerSize: 6 HatchSpacing: 0.1000 HatchLength: 0.0300 HatchAngle: 225 Hatches: '/' HatchTangency: on FlipBoundary: on XData: [1×100 double] YData: [1×100 double] Show all properties ```

Plot a red, dotted and dashed, square boundary line on a specified axis. `a` is the current axis.

```a = gca; boundaryline(a,[0,1,1,0,0],[0,0,1,1,0],'r-.') ```

## Input Arguments

collapse all

x coordinate data, specified as a numeric vector. The function uses this data to plot the x coordinates of the boundary line.

Data Types: `double`

y coordinate data, specified as a numeric vector. The function uses this data to plot the y coordinates of the boundary line.

Data Types: `double`

Valid axes, specified as a scalar handle. By default, this function plots to the current axes, obtainable with the `gca` function.

Data Types: `double`

Line style, marker, and color, specified as a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

Example: `'--or'` is a red dashed line with circle markers

Line StyleDescriptionResulting Line
`'-'`Solid line

`'--'`Dashed line

`':'`Dotted line

`'-.'`Dash-dotted line

MarkerDescriptionResulting Marker
`'o'`Circle

`'+'`Plus sign

`'*'`Asterisk

`'.'`Point

`'x'`Cross

`'_'`Horizontal line

`'|'`Vertical line

`'s'`Square

`'d'`Diamond

`'^'`Upward-pointing triangle

`'v'`Downward-pointing triangle

`'>'`Right-pointing triangle

`'<'`Left-pointing triangle

`'p'`Pentagram

`'h'`Hexagram

Color NameShort NameRGB TripletAppearance
`'red'``'r'``[1 0 0]`

`'green'``'g'``[0 1 0]`

`'blue'``'b'``[0 0 1]`

`'cyan'` `'c'``[0 1 1]`

`'magenta'``'m'``[1 0 1]`

`'yellow'``'y'``[1 1 0]`

`'black'``'k'``[0 0 0]`

`'white'``'w'``[1 1 1]`

### Name-Value Arguments

Specify optional pairs of arguments as `Name1=Value1,...,NameN=ValueN`, where `Name` is the argument name and `Value` is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose `Name` in quotes.

Example: `'Hatches','//'`

Note

These properties are only a subset. For a full list, see Line Properties.

Hatch style, specified as `'/'`, `'\'`, or `'|'`. The length of the string determines the hatch spacing. The more hatches specified, the closer the spacing. For example:

• For half-spaced forward slants, use `'Hatches','//'`.

• For a single-spaced perpendicular slant, use `'Hatches','|'`.

• For third-spaced backward slants, use `'Hatches','\\\'`.

Data Types: `char` | `string`

Flip boundary hatch angle by 180 degrees, specified as `'off'` or `'on'`.

• `'off'` — Do not flip the hatch angle.

• `'on'` — Flip the hatch angle by 180 degrees.

Data Types: `char` | `string`

Hatch angle tangency, specified as `'on'` or `'off'`.

• `'on'` — Hatch angle is relative to the tangent of the line segment. The function determines the tangency by evaluating the line integral traversing from the start to the end of the x and y data.

• `'off'` — Hatch angle is relative to 0.

Data Types: `char` | `string`

Length of hatch segments, specified as a numeric scalar.

Data Types: `double`

Angle of hatch segments, specified as a numeric scalar. The function automatically calculates the hatch angle if you specify a style for `'Hatches'`.

Data Types: `char` | `string`

Spacing between hatch segments, specified as a numeric scalar.

Data Types: `char` | `string`

Line style, specified as one of the options listed in this table.

Line StyleDescriptionResulting Line
`'-'`Solid line

`'--'`Dashed line

`':'`Dotted line

`'-.'`Dash-dotted line

`'none'`No lineNo line

Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.

The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.

## Output Arguments

collapse all

Boundary line object, returned as an `Aero.graphics.primitive.BoundaryLine` object.

## Version History

Introduced in R2021b