Repository: sunpy/sunpy

Issue:
Move the example for NorthOffsetFrame out of its docstring
`NorthOffsetFrame` has an example of its usage embedded in its docstring (see https://docs.sunpy.org/en/latest/api/sunpy.coordinates.NorthOffsetFrame.html).  This example should be moved to the gallery, with the docstring having a minigallery link instead.


Discussion:

Resolving patch:
diff --git a/examples/units_and_coordinates/north_offset_frame.py b/examples/units_and_coordinates/north_offset_frame.py
new file mode 100644
--- /dev/null
+++ b/examples/units_and_coordinates/north_offset_frame.py
@@ -0,0 +1,44 @@
+"""
+===============================================
+Offsetting the north pole of a coordinate frame
+===============================================
+
+How to use `~sunpy.coordinates.NorthOffsetFrame` to offset the north pole for a coordinate frame.
+"""
+
+import matplotlib.pyplot as plt
+
+import astropy.units as u
+from astropy.coordinates import SkyCoord
+
+import sunpy.map
+from sunpy.coordinates import NorthOffsetFrame
+from sunpy.data.sample import AIA_171_IMAGE
+
+##############################################################################
+# For an AIA observation from the sample data, let's create a modified
+# Heliographic Stonyhurst coordinate frame with its north pole offset to
+# a longitude of 45 degrees and a latitude of 20 degrees.
+
+aiamap = sunpy.map.Map(AIA_171_IMAGE)
+
+north = SkyCoord(45*u.deg, 20*u.deg,
+                 frame="heliographic_stonyhurst", obstime=aiamap.date)
+new_frame = NorthOffsetFrame(north=north)
+
+##############################################################################
+# Let's plot the normal Heliographic Stonyhurst coordinate frame as a white
+# grid and the modified coordinate frame as a blue grid.  If the north pole of
+# this new frame were placed at a point of interest, the lines of longitude
+# form great circles radially away from the point, and the lines of latitude
+# measure angular distance from the point.
+
+ax = plt.subplot(projection=aiamap)
+aiamap.plot(clip_interval=(1, 99.99)*u.percent)
+aiamap.draw_grid()
+
+overlay = ax.get_coords_overlay(new_frame)
+overlay[0].set_ticks(spacing=30. * u.deg)
+overlay.grid(ls='--', color='blue')
+
+plt.show()
diff --git a/sunpy/coordinates/offset_frame.py b/sunpy/coordinates/offset_frame.py
--- a/sunpy/coordinates/offset_frame.py
+++ b/sunpy/coordinates/offset_frame.py
@@ -23,42 +23,7 @@ class NorthOffsetFrame:
 
     Examples
     --------
-    A common use for this is to create a frame derived from Heliographic, which
-    has the north pole at some point of interest. In this new frame, lines of
-    longitude form great circles radially away from the point, and lines of
-    latitude measure angular distance from the point.
-
-    In this example the new frame is shifted so the new north pole is at (20,
-    20) in the Heliographic Stonyhurst frame. The new grid is overplotted in
-    blue.
-
-    .. plot::
-        :include-source:
-
-        import matplotlib.pyplot as plt
-        import astropy.units as u
-
-        from astropy.coordinates import SkyCoord
-        from sunpy.coordinates import NorthOffsetFrame
-
-        import sunpy.map
-        from sunpy.data.sample import AIA_171_IMAGE
-
-        m = sunpy.map.Map(AIA_171_IMAGE)
-
-        north = SkyCoord(20*u.deg, 20*u.deg, frame="heliographic_stonyhurst")
-        new_frame = NorthOffsetFrame(north=north)
-
-        ax = plt.subplot(projection=m)
-        m.plot()
-
-        overlay = ax.get_coords_overlay('heliographic_stonyhurst')
-        overlay[0].set_ticks(spacing=30. * u.deg, color='white')
-        overlay.grid(ls='-', color='white')
-
-        overlay = ax.get_coords_overlay(new_frame)
-        overlay[0].set_ticks(spacing=30. * u.deg)
-        overlay.grid(ls='-', color='blue')
+    .. minigallery:: sunpy.coordinates.NorthOffsetFrame
 
     Notes
     -----


Test patch: