SciPy

scipy.ndimage.rotate

scipy.ndimage.rotate(input, angle, axes=(1, 0), reshape=True, output=None, order=3, mode='constant', cval=0.0, prefilter=True)[source]

Rotate an array.

The array is rotated in the plane defined by the two axes given by the axes parameter using spline interpolation of the requested order.

Parameters:
%(input)s
angle : float

The rotation angle in degrees.

axes : tuple of 2 ints, optional

The two axes that define the plane of rotation. Default is the first two axes.

reshape : bool, optional

If reshape is true, the output shape is adapted so that the input array is contained completely in the output. Default is True.

%(output)s
order : int, optional

The order of the spline interpolation, default is 3. The order has to be in the range 0-5.

%(mode)s
%(cval)s
%(prefilter)s
Returns:
rotate : ndarray

The rotated input.