# rose

(Not recommended) Angle histogram

`rose` is not recommended. Use `polarhistogram` instead. For information on updating your code, see Version History.

## Syntax

``rose(theta)``
``rose(theta,x)``
``rose(theta,nbins)``
``rose(ax,___)``
``ln = rose(___)``
``[t,r] = rose(___)``

## Description

````rose(theta)` creates an angle histogram, which is a polar plot that shows the distribution of angles in `theta`.```
````rose(theta,x)` uses the number of bins and the bin locations specified by vector `x`. The values in `x` specify the center angle of each bin, and `length(x)` is the number of bins.```

example

````rose(theta,nbins)` plots the specified number of equally spaced bins in the range `[0,2*pi]`.```
````rose(ax,___)` plots into the specified axes instead of the current axes (`gca`).```
````ln = rose(___)` returns the `Line` object used to create the angle histogram. Use `ln` to modify the histogram after it is created. For a list of properties, see Line Properties.```
````[t,r] = rose(___)` returns the angle and radius values of the bins that can be used in `polarplot(t,r)` to generate the histogram. This syntax does not generate a plot. ```

## Examples

collapse all

Create an angle histogram of values between 0 and $2\pi$. Distribute the data among 10 bins.

```theta = [0.4 1.4 3.1 2.3 0.4 2.5 3.9 2.8 2.3 1.6 4.6 4.5 6.1 3.9 5.1]; rose(theta,10)```

## Input Arguments

collapse all

Data to distribute among bins, specified as a vector of angles expressed in radians. If you do not specify `nbins`, then `rose` distributes the data among 20 bins or fewer. The length of each bin corresponds to the number of elements in `theta` that fall within the start and end angles of that bin, from 0 to the greatest number of elements deposited in any one bin.

Bin centers, specified as a vector of angles expressed in radians. For example, if `x` is a five-element vector, `rose` distributes the elements of `theta` among five bins centered at the specified values in `x`.

Number of bins, specified as a positive integer. `rose` plots `nbins` equally spaced bins in the range `[0,2*pi]`. If you do not specify `nbins`, then `rose` distributes the data among 20 bins or fewer.

Target axes, specified as an `Axes` object. If you do not specify the axes, MATLAB® plots into the current axes or it creates an `Axes` object if one does not exist. `rose` does not support plotting into `PolarAxes` objects.

## Output Arguments

collapse all

Angle histogram, returned as a `Line` object. Use this output to modify the appearance of the angle histogram. For more information about the properties you can set for these objects, see Line Properties.

Angle values of bins, returned as a vector. Use `t` with `r` to generate an angle histogram in a `PolarAxes` object by passing them as inputs to the `polarplot` function. Each bin in the histogram is represented by four distinct points. The length of `t` is 4 times the number of bins.

Radius values of bins, returned as a vector. Use `r` with `t` to generate an angle histogram in a `PolarAxes` object by passing them as inputs to the `polarplot` function. Each bin in the histogram is represented by four distinct points. The length of `r` is 4 times the number of bins.

## Version History

Introduced before R2006a

expand all