prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  The ticks for the HGS overlay on map plots are white and invisible by default
  Also the HPC ticks are on all four axes.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `sunpy/visualization/wcsaxes_compat.py`
  Content:
  ```
  1 """
  2 This module provides functions to make WCSAxes work in SunPy.
  3 """
  4 import matplotlib.pyplot as plt
  5 
  6 import astropy.units as u
  7 from astropy.visualization import wcsaxes
  8 
  9 # Force is put here to enable disabling all checks in this module.
  10 # It should only be used by tests and other such hacks.
  11 _FORCE_NO_WCSAXES = False
  12 
  13 __all__ = ["is_wcsaxes", "gca_wcs", "get_world_transform",
  14            "default_wcs_grid", "wcsaxes_heliographic_overlay"]
  15 
  16 
  17 def is_wcsaxes(axes):
  18     """
  19     Tests a `matplotlib.axes.Axes` object to see if it is an instance of
  20     `~astropy.visualization.wcsaxes.WCSAxes`.
  21 
  22     Parameters
  23     ----------
  24     axes : `matplotlib.axes`
  25         Axes to test.
  26 
  27     Returns
  28     -------
  29     `bool`
  30         Result of the test.
  31     """
  32     if not _FORCE_NO_WCSAXES:
  33         return isinstance(axes, wcsaxes.WCSAxes)
  34     else:
  35         return False
  36 
  37 
  38 def gca_wcs(wcs, fig=None, slices=None):
  39     """
  40     Get the current axes, and return a `~astropy.visualization.wcsaxes.WCSAxes`
  41     if possible.
  42 
  43     Parameters
  44     ----------
  45     wcs : `astropy.wcs.WCS`
  46         A `~astropy.wcs.WCS` object used to create a new axes.
  47     fig : `matplotlib.figure.Figure`
  48         The figure in which to check for the axes.
  49     slices : `tuple`
  50         ``slices`` is passed to `~astropy.visualization.wcsaxes.WCSAxes` to describe
  51         which two dimensions of the `~astropy.wcs.WCS` object are being plotted.
  52         This slices the multidimensional wcs object in the way it needs to be sliced.
  53 
  54     Returns
  55     -------
  56     `matplotlib.axes.Axes` or `~astropy.visualization.wcsaxes.WCSAxes`
  57         The current axes, or a new one if created.
  58     """
  59     if not fig:
  60         fig = plt.gcf()
  61 
  62     if not len(fig.get_axes()):
  63         if not _FORCE_NO_WCSAXES:
  64             ax = plt.gca(projection=wcs, slices=slices)
  65         else:
  66             ax = plt.gca()
  67     else:
  68         ax = plt.gca()
  69 
  70     return ax
  71 
  72 
  73 def get_world_transform(axes):
  74     """
  75     Get the transformation to world coordinates.
  76 
  77     If the axes is a `~astropy.visualization.wcsaxes.WCSAxes` instance this
  78     returns the transform to the "world" coordinates, otherwise it returns
  79     the transform to the matplotlib data coordinates, which are assumed to be in
  80     world coordinates.
  81 
  82     Parameters
  83     ----------
  84     axes : `~astropy.visualization.wcsaxes.WCSAxes` or `~matplotlib.axes.Axes`
  85         The axes to get the transform from.
  86 
  87     Returns
  88     -------
  89     `~matplotlib.transforms.CompositeGenericTransform`
  90         The transformation object.
  91     """
  92     if is_wcsaxes(axes):
  93         transform = axes.get_transform('world')
  94     else:
  95         transform = axes.transData
  96 
  97     return transform
  98 
  99 
  100 def default_wcs_grid(axes):
  101     """
  102     Apply some default `~astropy.visualization.wcsaxes.WCSAxes` grid
  103     formatting.
  104 
  105     Parameters
  106     ----------
  107     axes : `~astropy.visualization.wcsaxes.WCSAxes`
  108         The `~astropy.visualization.wcsaxes.WCSAxes` object to draw the world
  109         coordinate grid on.
  110     """
  111     axes.coords.grid(color='white', alpha=0.6, linestyle='dotted',
  112                      linewidth=0.5)
  113 
  114 
  115 @u.quantity_input
  116 def wcsaxes_heliographic_overlay(axes, grid_spacing: u.deg = 10*u.deg, **kwargs):
  117     """
  118     Create a heliographic overlay using
  119     `~astropy.visualization.wcsaxes.WCSAxes`.
  120 
  121     Will draw a grid and label the top axes.
  122 
  123     Parameters
  124     ----------
  125     axes : `~astropy.visualization.wcsaxes.WCSAxes`
  126         The `~astropy.visualization.wcsaxes.WCSAxes` object to create the HGS overlay on.
  127     grid_spacing: `~astropy.units.Quantity`
  128         Spacing for longitude and latitude grid in degrees.
  129 
  130     Returns
  131     -------
  132     `~astropy.visualization.wcsaxes.WCSAxes`
  133         The overlay object.
  134 
  135     Notes
  136     -----
  137     Keywords are passed to `~astropy.visualization.wcsaxes.coordinates_map.CoordinatesMap.grid`.
  138     """
  139     # Unpack spacing
  140     if isinstance(grid_spacing, u.Quantity) and grid_spacing.size == 1:
  141         lon_space = lat_space = grid_spacing
  142     elif grid_spacing.size == 2:
  143         lon_space, lat_space = grid_spacing
  144     else:
  145         raise ValueError("grid_spacing must be a Quantity of length one or two.")
  146 
  147     overlay = axes.get_coords_overlay('heliographic_stonyhurst')
  148 
  149     lon = overlay[0]
  150     lat = overlay[1]
  151 
  152     lon.coord_wrap = 180
  153     lon.set_major_formatter('dd')
  154 
  155     lon.set_axislabel('Solar Longitude', minpad=0.8)
  156     lat.set_axislabel('Solar Latitude', minpad=0.9)
  157 
  158     lon.set_ticks_position('tr')
  159     lat.set_ticks_position('tr')
  160 
  161     grid_kw = {'color': 'white', 'zorder': 100, 'alpha': 0.5}
  162     grid_kw.update(kwargs)
  163 
  164     lon.set_ticks(spacing=lon_space, color=grid_kw['color'])
  165     lat.set_ticks(spacing=lat_space, color=grid_kw['color'])
  166 
  167     overlay.grid(**grid_kw)
  168 
  169     if axes.title:
  170         x, y = axes.title.get_position()
  171         axes.title.set_position([x, y + 0.08])
  172 
  173     return overlay
  174
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/sunpy/visualization/wcsaxes_compat.py b/sunpy/visualization/wcsaxes_compat.py
  --- a/sunpy/visualization/wcsaxes_compat.py
  +++ b/sunpy/visualization/wcsaxes_compat.py
  @@ -144,6 +144,12 @@
       else:
           raise ValueError("grid_spacing must be a Quantity of length one or two.")
   
  +    # Set the native coordinates to be bottom and left only so they don't share
  +    # axes with the overlay.
  +    c1, c2 = axes.coords
  +    c1.set_ticks_position('bl')
  +    c2.set_ticks_position('bl')
  +
       overlay = axes.get_coords_overlay('heliographic_stonyhurst')
   
       lon = overlay[0]
  @@ -161,8 +167,10 @@
       grid_kw = {'color': 'white', 'zorder': 100, 'alpha': 0.5}
       grid_kw.update(kwargs)
   
  -    lon.set_ticks(spacing=lon_space, color=grid_kw['color'])
  -    lat.set_ticks(spacing=lat_space, color=grid_kw['color'])
  +    # Don't plot white ticks by default (only if explicitly asked)
  +    tick_color = grid_kw['color'] if 'color' in kwargs else 'k'
  +    lon.set_ticks(spacing=lon_space, color=tick_color)
  +    lat.set_ticks(spacing=lat_space, color=tick_color)
   
       overlay.grid(**grid_kw)
  
verification_info: {"golden_diff": "diff --git a/sunpy/visualization/wcsaxes_compat.py b/sunpy/visualization/wcsaxes_compat.py\n--- a/sunpy/visualization/wcsaxes_compat.py\n+++ b/sunpy/visualization/wcsaxes_compat.py\n@@ -144,6 +144,12 @@\n     else:\n         raise ValueError(\"grid_spacing must be a Quantity of length one or two.\")\n \n+    # Set the native coordinates to be bottom and left only so they don't share\n+    # axes with the overlay.\n+    c1, c2 = axes.coords\n+    c1.set_ticks_position('bl')\n+    c2.set_ticks_position('bl')\n+\n     overlay = axes.get_coords_overlay('heliographic_stonyhurst')\n \n     lon = overlay[0]\n@@ -161,8 +167,10 @@\n     grid_kw = {'color': 'white', 'zorder': 100, 'alpha': 0.5}\n     grid_kw.update(kwargs)\n \n-    lon.set_ticks(spacing=lon_space, color=grid_kw['color'])\n-    lat.set_ticks(spacing=lat_space, color=grid_kw['color'])\n+    # Don't plot white ticks by default (only if explicitly asked)\n+    tick_color = grid_kw['color'] if 'color' in kwargs else 'k'\n+    lon.set_ticks(spacing=lon_space, color=tick_color)\n+    lat.set_ticks(spacing=lat_space, color=tick_color)\n \n     overlay.grid(**grid_kw)\n", "issue": "The ticks for the HGS overlay on map plots are white and invisible by default\nAlso the HPC ticks are on all four axes.\n", "before_files": [{"content": "\"\"\"\nThis module provides functions to make WCSAxes work in SunPy.\n\"\"\"\nimport matplotlib.pyplot as plt\n\nimport astropy.units as u\nfrom astropy.visualization import wcsaxes\n\n# Force is put here to enable disabling all checks in this module.\n# It should only be used by tests and other such hacks.\n_FORCE_NO_WCSAXES = False\n\n__all__ = [\"is_wcsaxes\", \"gca_wcs\", \"get_world_transform\",\n           \"default_wcs_grid\", \"wcsaxes_heliographic_overlay\"]\n\n\ndef is_wcsaxes(axes):\n    \"\"\"\n    Tests a `matplotlib.axes.Axes` object to see if it is an instance of\n    `~astropy.visualization.wcsaxes.WCSAxes`.\n\n    Parameters\n    ----------\n    axes : `matplotlib.axes`\n        Axes to test.\n\n    Returns\n    -------\n    `bool`\n        Result of the test.\n    \"\"\"\n    if not _FORCE_NO_WCSAXES:\n        return isinstance(axes, wcsaxes.WCSAxes)\n    else:\n        return False\n\n\ndef gca_wcs(wcs, fig=None, slices=None):\n    \"\"\"\n    Get the current axes, and return a `~astropy.visualization.wcsaxes.WCSAxes`\n    if possible.\n\n    Parameters\n    ----------\n    wcs : `astropy.wcs.WCS`\n        A `~astropy.wcs.WCS` object used to create a new axes.\n    fig : `matplotlib.figure.Figure`\n        The figure in which to check for the axes.\n    slices : `tuple`\n        ``slices`` is passed to `~astropy.visualization.wcsaxes.WCSAxes` to describe\n        which two dimensions of the `~astropy.wcs.WCS` object are being plotted.\n        This slices the multidimensional wcs object in the way it needs to be sliced.\n\n    Returns\n    -------\n    `matplotlib.axes.Axes` or `~astropy.visualization.wcsaxes.WCSAxes`\n        The current axes, or a new one if created.\n    \"\"\"\n    if not fig:\n        fig = plt.gcf()\n\n    if not len(fig.get_axes()):\n        if not _FORCE_NO_WCSAXES:\n            ax = plt.gca(projection=wcs, slices=slices)\n        else:\n            ax = plt.gca()\n    else:\n        ax = plt.gca()\n\n    return ax\n\n\ndef get_world_transform(axes):\n    \"\"\"\n    Get the transformation to world coordinates.\n\n    If the axes is a `~astropy.visualization.wcsaxes.WCSAxes` instance this\n    returns the transform to the \"world\" coordinates, otherwise it returns\n    the transform to the matplotlib data coordinates, which are assumed to be in\n    world coordinates.\n\n    Parameters\n    ----------\n    axes : `~astropy.visualization.wcsaxes.WCSAxes` or `~matplotlib.axes.Axes`\n        The axes to get the transform from.\n\n    Returns\n    -------\n    `~matplotlib.transforms.CompositeGenericTransform`\n        The transformation object.\n    \"\"\"\n    if is_wcsaxes(axes):\n        transform = axes.get_transform('world')\n    else:\n        transform = axes.transData\n\n    return transform\n\n\ndef default_wcs_grid(axes):\n    \"\"\"\n    Apply some default `~astropy.visualization.wcsaxes.WCSAxes` grid\n    formatting.\n\n    Parameters\n    ----------\n    axes : `~astropy.visualization.wcsaxes.WCSAxes`\n        The `~astropy.visualization.wcsaxes.WCSAxes` object to draw the world\n        coordinate grid on.\n    \"\"\"\n    axes.coords.grid(color='white', alpha=0.6, linestyle='dotted',\n                     linewidth=0.5)\n\n\n@u.quantity_input\ndef wcsaxes_heliographic_overlay(axes, grid_spacing: u.deg = 10*u.deg, **kwargs):\n    \"\"\"\n    Create a heliographic overlay using\n    `~astropy.visualization.wcsaxes.WCSAxes`.\n\n    Will draw a grid and label the top axes.\n\n    Parameters\n    ----------\n    axes : `~astropy.visualization.wcsaxes.WCSAxes`\n        The `~astropy.visualization.wcsaxes.WCSAxes` object to create the HGS overlay on.\n    grid_spacing: `~astropy.units.Quantity`\n        Spacing for longitude and latitude grid in degrees.\n\n    Returns\n    -------\n    `~astropy.visualization.wcsaxes.WCSAxes`\n        The overlay object.\n\n    Notes\n    -----\n    Keywords are passed to `~astropy.visualization.wcsaxes.coordinates_map.CoordinatesMap.grid`.\n    \"\"\"\n    # Unpack spacing\n    if isinstance(grid_spacing, u.Quantity) and grid_spacing.size == 1:\n        lon_space = lat_space = grid_spacing\n    elif grid_spacing.size == 2:\n        lon_space, lat_space = grid_spacing\n    else:\n        raise ValueError(\"grid_spacing must be a Quantity of length one or two.\")\n\n    overlay = axes.get_coords_overlay('heliographic_stonyhurst')\n\n    lon = overlay[0]\n    lat = overlay[1]\n\n    lon.coord_wrap = 180\n    lon.set_major_formatter('dd')\n\n    lon.set_axislabel('Solar Longitude', minpad=0.8)\n    lat.set_axislabel('Solar Latitude', minpad=0.9)\n\n    lon.set_ticks_position('tr')\n    lat.set_ticks_position('tr')\n\n    grid_kw = {'color': 'white', 'zorder': 100, 'alpha': 0.5}\n    grid_kw.update(kwargs)\n\n    lon.set_ticks(spacing=lon_space, color=grid_kw['color'])\n    lat.set_ticks(spacing=lat_space, color=grid_kw['color'])\n\n    overlay.grid(**grid_kw)\n\n    if axes.title:\n        x, y = axes.title.get_position()\n        axes.title.set_position([x, y + 0.08])\n\n    return overlay\n", "path": "sunpy/visualization/wcsaxes_compat.py"}], "after_files": [{"content": "\"\"\"\nThis module provides functions to make WCSAxes work in SunPy.\n\"\"\"\nimport matplotlib.pyplot as plt\n\nimport astropy.units as u\nfrom astropy.visualization import wcsaxes\n\n# Force is put here to enable disabling all checks in this module.\n# It should only be used by tests and other such hacks.\n_FORCE_NO_WCSAXES = False\n\n__all__ = [\"is_wcsaxes\", \"gca_wcs\", \"get_world_transform\",\n           \"default_wcs_grid\", \"wcsaxes_heliographic_overlay\"]\n\n\ndef is_wcsaxes(axes):\n    \"\"\"\n    Tests a `matplotlib.axes.Axes` object to see if it is an instance of\n    `~astropy.visualization.wcsaxes.WCSAxes`.\n\n    Parameters\n    ----------\n    axes : `matplotlib.axes`\n        Axes to test.\n\n    Returns\n    -------\n    `bool`\n        Result of the test.\n    \"\"\"\n    if not _FORCE_NO_WCSAXES:\n        return isinstance(axes, wcsaxes.WCSAxes)\n    else:\n        return False\n\n\ndef gca_wcs(wcs, fig=None, slices=None):\n    \"\"\"\n    Get the current axes, and return a `~astropy.visualization.wcsaxes.WCSAxes`\n    if possible.\n\n    Parameters\n    ----------\n    wcs : `astropy.wcs.WCS`\n        A `~astropy.wcs.WCS` object used to create a new axes.\n    fig : `matplotlib.figure.Figure`\n        The figure in which to check for the axes.\n    slices : `tuple`\n        ``slices`` is passed to `~astropy.visualization.wcsaxes.WCSAxes` to describe\n        which two dimensions of the `~astropy.wcs.WCS` object are being plotted.\n        This slices the multidimensional wcs object in the way it needs to be sliced.\n\n    Returns\n    -------\n    `matplotlib.axes.Axes` or `~astropy.visualization.wcsaxes.WCSAxes`\n        The current axes, or a new one if created.\n    \"\"\"\n    if not fig:\n        fig = plt.gcf()\n\n    if not len(fig.get_axes()):\n        if not _FORCE_NO_WCSAXES:\n            ax = plt.gca(projection=wcs, slices=slices)\n        else:\n            ax = plt.gca()\n    else:\n        ax = plt.gca()\n\n    return ax\n\n\ndef get_world_transform(axes):\n    \"\"\"\n    Get the transformation to world coordinates.\n\n    If the axes is a `~astropy.visualization.wcsaxes.WCSAxes` instance this\n    returns the transform to the \"world\" coordinates, otherwise it returns\n    the transform to the matplotlib data coordinates, which are assumed to be in\n    world coordinates.\n\n    Parameters\n    ----------\n    axes : `~astropy.visualization.wcsaxes.WCSAxes` or `~matplotlib.axes.Axes`\n        The axes to get the transform from.\n\n    Returns\n    -------\n    `~matplotlib.transforms.CompositeGenericTransform`\n        The transformation object.\n    \"\"\"\n    if is_wcsaxes(axes):\n        transform = axes.get_transform('world')\n    else:\n        transform = axes.transData\n\n    return transform\n\n\ndef default_wcs_grid(axes):\n    \"\"\"\n    Apply some default `~astropy.visualization.wcsaxes.WCSAxes` grid\n    formatting.\n\n    Parameters\n    ----------\n    axes : `~astropy.visualization.wcsaxes.WCSAxes`\n        The `~astropy.visualization.wcsaxes.WCSAxes` object to draw the world\n        coordinate grid on.\n    \"\"\"\n    axes.coords.grid(color='white', alpha=0.6, linestyle='dotted',\n                     linewidth=0.5)\n\n\n@u.quantity_input\ndef wcsaxes_heliographic_overlay(axes, grid_spacing: u.deg = 10*u.deg, **kwargs):\n    \"\"\"\n    Create a heliographic overlay using\n    `~astropy.visualization.wcsaxes.WCSAxes`.\n\n    Will draw a grid and label the top axes.\n\n    Parameters\n    ----------\n    axes : `~astropy.visualization.wcsaxes.WCSAxes`\n        The `~astropy.visualization.wcsaxes.WCSAxes` object to create the HGS overlay on.\n    grid_spacing: `~astropy.units.Quantity`\n        Spacing for longitude and latitude grid in degrees.\n\n    Returns\n    -------\n    `~astropy.visualization.wcsaxes.WCSAxes`\n        The overlay object.\n\n    Notes\n    -----\n    Keywords are passed to `~astropy.visualization.wcsaxes.coordinates_map.CoordinatesMap.grid`.\n    \"\"\"\n    # Unpack spacing\n    if isinstance(grid_spacing, u.Quantity) and grid_spacing.size == 1:\n        lon_space = lat_space = grid_spacing\n    elif grid_spacing.size == 2:\n        lon_space, lat_space = grid_spacing\n    else:\n        raise ValueError(\"grid_spacing must be a Quantity of length one or two.\")\n\n    # Set the native coordinates to be bottom and left only so they don't share\n    # axes with the overlay.\n    c1, c2 = axes.coords\n    c1.set_ticks_position('bl')\n    c2.set_ticks_position('bl')\n\n    overlay = axes.get_coords_overlay('heliographic_stonyhurst')\n\n    lon = overlay[0]\n    lat = overlay[1]\n\n    lon.coord_wrap = 180\n    lon.set_major_formatter('dd')\n\n    lon.set_axislabel('Solar Longitude', minpad=0.8)\n    lat.set_axislabel('Solar Latitude', minpad=0.9)\n\n    lon.set_ticks_position('tr')\n    lat.set_ticks_position('tr')\n\n    grid_kw = {'color': 'white', 'zorder': 100, 'alpha': 0.5}\n    grid_kw.update(kwargs)\n\n    # Don't plot white ticks by default (only if explicitly asked)\n    tick_color = grid_kw['color'] if 'color' in kwargs else 'k'\n    lon.set_ticks(spacing=lon_space, color=tick_color)\n    lat.set_ticks(spacing=lat_space, color=tick_color)\n\n    overlay.grid(**grid_kw)\n\n    if axes.title:\n        x, y = axes.title.get_position()\n        axes.title.set_position([x, y + 0.08])\n\n    return overlay\n", "path": "sunpy/visualization/wcsaxes_compat.py"}]}