# hold

Retain current plot when adding new plots.

## 📝 Syntax

* hold('on')
* hold('off')
* hold('all')
* hold()
* hold(ax, ...)

## 📥 Input argument

* 'on' - turn hold on.
* 'off' - turn hold off.
* 'all' - same as hold on.
* ax - Target axes: axes.

## 📤 Output argument

* ax - a graphics object: axes type.

## 📄 Description

hold allows to construct a plot sequence incrementally.

## 💡 Example

```matlab
f = figure();
x = linspace(-pi, pi);
y1 = cos(x);
plot(x, y1)
hold on
y2 = sin(x);
plot(x, y2)
hold off

```

![](broken-reference)

## 🔗 See also

[ishold](https://nelson-9.gitbook.io/Nelson/markdown/en/graphics/ishold), [newplot](https://nelson-9.gitbook.io/Nelson/markdown/en/graphics/newplot).

## 🕔 History

| Version | 📄 Description  |
| ------- | --------------- |
| 1.0.0   | initial version |
