prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Resampling Maps in the example gallery gives a confusing example for the superpixel method
  ### Provide a general description of the issue or problem.
  
  That's a minor thing perhaps but checking this [page](https://docs.sunpy.org/en/stable/generated/gallery/map/map_resampling_and_superpixels.html) I got confused by the example for the superpixel method. 
  It says:
  `new_dimensions = u.Quantity(aia_map.dimensions) / 16`
  `aia_superpixel_map = aia_map.superpixel([new_dimensions]`
  
  The first line should be instead e.g.:
  `new_dimensions=[16,16]*u.pixel `
  
  </issue>
  <code>
  [start of examples/map/map_resampling_and_superpixels.py]
  1 """
  2 ===============
  3 Resampling Maps
  4 ===============
  5 
  6 How to resample a map using the resample method, which implements interpolation, or
  7 using superpixels, which combines pixels.
  8 """
  9 import matplotlib.pyplot as plt
  10 
  11 import astropy.units as u
  12 
  13 import sunpy.data.sample
  14 import sunpy.map
  15 
  16 ###############################################################################
  17 # We start with the sample data.
  18 
  19 aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
  20 
  21 ##############################################################################
  22 # To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,
  23 # specifying the new dimensions in pixels. By default, this method uses linear interpolation
  24 # but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').
  25 
  26 new_dimensions = [40, 40] * u.pixel
  27 aia_resampled_map = aia_map.resample(new_dimensions)
  28 
  29 ##############################################################################
  30 # Let's plot the result.
  31 
  32 fig = plt.figure()
  33 ax = fig.add_subplot(projection=aia_resampled_map)
  34 aia_resampled_map.plot(axes=ax)
  35 plt.show()
  36 
  37 ##############################################################################
  38 # Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.
  39 # This can be used to increase the signal to noise ratio by reducing the
  40 # resolution of the image by combining pixels. This means that the new dimension
  41 # must divide the original size exactly.
  42 # For example you can reduce the AIA map resolution by a factor of 16.
  43 
  44 new_dimensions = u.Quantity(aia_map.dimensions) / 16
  45 aia_superpixel_map = aia_map.superpixel(new_dimensions)
  46 
  47 ##############################################################################
  48 # Let's plot the result.
  49 
  50 fig = plt.figure()
  51 ax = fig.add_subplot(projection=aia_superpixel_map)
  52 aia_superpixel_map.plot(axes=ax)
  53 plt.show()
  54
  [end of examples/map/map_resampling_and_superpixels.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/examples/map/map_resampling_and_superpixels.py b/examples/map/map_resampling_and_superpixels.py
  --- a/examples/map/map_resampling_and_superpixels.py
  +++ b/examples/map/map_resampling_and_superpixels.py
  @@ -13,15 +13,16 @@
   import sunpy.data.sample
   import sunpy.map
   
  -###############################################################################
  +##############################################################################
   # We start with the sample data.
   
   aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
   
   ##############################################################################
  -# To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,
  -# specifying the new dimensions in pixels. By default, this method uses linear interpolation
  -# but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').
  +# To reduce the angular resolution of the map, you can use the
  +# :meth:`~sunpy.map.GenericMap.resample` method, specifying the new dimensions
  +# in pixels. By default, this method uses linear interpolation but this can be
  +# changed with the ``method`` argument ('nearest', 'linear' or 'spline').
   
   new_dimensions = [40, 40] * u.pixel
   aia_resampled_map = aia_map.resample(new_dimensions)
  @@ -35,14 +36,15 @@
   plt.show()
   
   ##############################################################################
  -# Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.
  -# This can be used to increase the signal to noise ratio by reducing the
  -# resolution of the image by combining pixels. This means that the new dimension
  -# must divide the original size exactly.
  -# For example you can reduce the AIA map resolution by a factor of 16.
  -
  -new_dimensions = u.Quantity(aia_map.dimensions) / 16
  -aia_superpixel_map = aia_map.superpixel(new_dimensions)
  +# Another way to reduce the angular resolution of the map is by using the
  +# :meth:`~sunpy.map.GenericMap.superpixel` method, which combines pixels.
  +# The superpixel dimensions do not need to be square, and the intensity of
  +# each superpixel defaults to the sum of the constituent pixels. For example,
  +# you can reduce the AIA map resolution by a factor of 16 by specifying 16x16
  +# superpixels.
  +
  +superpixel_size = [16, 16] * u.pixel
  +aia_superpixel_map = aia_map.superpixel(superpixel_size)
   
   ##############################################################################
   # Let's plot the result.
  
verification_info: {"golden_diff": "diff --git a/examples/map/map_resampling_and_superpixels.py b/examples/map/map_resampling_and_superpixels.py\n--- a/examples/map/map_resampling_and_superpixels.py\n+++ b/examples/map/map_resampling_and_superpixels.py\n@@ -13,15 +13,16 @@\n import sunpy.data.sample\n import sunpy.map\n \n-###############################################################################\n+##############################################################################\n # We start with the sample data.\n \n aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)\n \n ##############################################################################\n-# To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,\n-# specifying the new dimensions in pixels. By default, this method uses linear interpolation\n-# but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').\n+# To reduce the angular resolution of the map, you can use the\n+# :meth:`~sunpy.map.GenericMap.resample` method, specifying the new dimensions\n+# in pixels. By default, this method uses linear interpolation but this can be\n+# changed with the ``method`` argument ('nearest', 'linear' or 'spline').\n \n new_dimensions = [40, 40] * u.pixel\n aia_resampled_map = aia_map.resample(new_dimensions)\n@@ -35,14 +36,15 @@\n plt.show()\n \n ##############################################################################\n-# Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.\n-# This can be used to increase the signal to noise ratio by reducing the\n-# resolution of the image by combining pixels. This means that the new dimension\n-# must divide the original size exactly.\n-# For example you can reduce the AIA map resolution by a factor of 16.\n-\n-new_dimensions = u.Quantity(aia_map.dimensions) / 16\n-aia_superpixel_map = aia_map.superpixel(new_dimensions)\n+# Another way to reduce the angular resolution of the map is by using the\n+# :meth:`~sunpy.map.GenericMap.superpixel` method, which combines pixels.\n+# The superpixel dimensions do not need to be square, and the intensity of\n+# each superpixel defaults to the sum of the constituent pixels. For example,\n+# you can reduce the AIA map resolution by a factor of 16 by specifying 16x16\n+# superpixels.\n+\n+superpixel_size = [16, 16] * u.pixel\n+aia_superpixel_map = aia_map.superpixel(superpixel_size)\n \n ##############################################################################\n # Let's plot the result.\n", "issue": "Resampling Maps in the example gallery gives a confusing example for the superpixel method\n### Provide a general description of the issue or problem.\n\nThat's a minor thing perhaps but checking this [page](https://docs.sunpy.org/en/stable/generated/gallery/map/map_resampling_and_superpixels.html) I got confused by the example for the superpixel method. \r\nIt says:\r\n`new_dimensions = u.Quantity(aia_map.dimensions) / 16`\r\n`aia_superpixel_map = aia_map.superpixel([new_dimensions]`\r\n\r\nThe first line should be instead e.g.:\r\n`new_dimensions=[16,16]*u.pixel `\n", "before_files": [{"content": "\"\"\"\n===============\nResampling Maps\n===============\n\nHow to resample a map using the resample method, which implements interpolation, or\nusing superpixels, which combines pixels.\n\"\"\"\nimport matplotlib.pyplot as plt\n\nimport astropy.units as u\n\nimport sunpy.data.sample\nimport sunpy.map\n\n###############################################################################\n# We start with the sample data.\n\naia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)\n\n##############################################################################\n# To reduce the angular resolution of the map you can use the `~sunpy.map.GenericMap.resample` method,\n# specifying the new dimensions in pixels. By default, this method uses linear interpolation\n# but this can be changed with the ``method`` argument ('nearest', 'linear' or 'spline').\n\nnew_dimensions = [40, 40] * u.pixel\naia_resampled_map = aia_map.resample(new_dimensions)\n\n##############################################################################\n# Let's plot the result.\n\nfig = plt.figure()\nax = fig.add_subplot(projection=aia_resampled_map)\naia_resampled_map.plot(axes=ax)\nplt.show()\n\n##############################################################################\n# Another way to resample is by using the `~sunpy.map.GenericMap.superpixel` method.\n# This can be used to increase the signal to noise ratio by reducing the\n# resolution of the image by combining pixels. This means that the new dimension\n# must divide the original size exactly.\n# For example you can reduce the AIA map resolution by a factor of 16.\n\nnew_dimensions = u.Quantity(aia_map.dimensions) / 16\naia_superpixel_map = aia_map.superpixel(new_dimensions)\n\n##############################################################################\n# Let's plot the result.\n\nfig = plt.figure()\nax = fig.add_subplot(projection=aia_superpixel_map)\naia_superpixel_map.plot(axes=ax)\nplt.show()\n", "path": "examples/map/map_resampling_and_superpixels.py"}]}