Rotating a Map

How to rotate a map.

import matplotlib.pyplot as plt

import astropy.units as u


We start with the sample data

aia_map =

GenericMap provides the rotate method which accepts an angle. This returns a rotated map and does not rotate in place. The data array size is expanded so that none of the original data is lost due to clipping. Note that subsequent rotations are not compounded. The map is only rotated by the specified amount from the original maps orientation.

aia_rotated = aia_map.rotate(angle=30 * u.deg)


/home/docs/checkouts/ SunpyUserWarning: Input data has been cast to float64.
  warnings.warn("Input data has been cast to float64.", SunpyUserWarning)

Let’s now plot the results.

fig = plt.figure()
ax = plt.subplot(projection=aia_rotated)
AIA $171 \; \mathrm{\mathring{A}}$ 2011-06-07 06:33:02

Total running time of the script: ( 0 minutes 3.073 seconds)

Gallery generated by Sphinx-Gallery