Skip to content

Passing draw_grid=False is ignored on CoordinateHelper #426

Open

Description

@wtbarnes

Description

When trying to control how the grid lines are drawn, passing draw_grid=False to the associate coordinate helpers from the axes instance emitted by plot() is ignored. However if .grid is never called, the gridlines are not drawn.

Steps to Reproduce

import astropy.units as u
import astropy.wcs
import numpy as np
from ndcube import NDCube

data = np.random.rand(4, 4, 5)
wcs = astropy.wcs.WCS(naxis=3)
wcs.wcs.ctype = 'WAVE', 'HPLT-TAN', 'HPLN-TAN'
wcs.wcs.cunit = 'Angstrom', 'deg', 'deg'
wcs.wcs.cdelt = 0.2, 0.5, 0.4
wcs.wcs.crpix = 0, 2, 2
wcs.wcs.crval = 10, 0.5, 1
my_cube = NDCube(data, wcs=wcs)

# Calling `grid` with keyword
ax = my_cube[:,:,0].plot()
lat,lon = ax.coords
lat.grid(draw_grid=False)
lon.grid(draw_grid=False)

produces

image

but dropping the lat.grid and lon.grid gives no grid lines at all,

image

System Details

  • ndcube Version: master
  • SunPy Version: master
  • Astropy Version: 4.2
  • Python Version: 3.8
  • OS information: Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions