Skip to content

Commit

Permalink
Plotting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed May 16, 2015
1 parent befc319 commit 966cd17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sunpy/map/mapbase.py
Expand Up @@ -1041,6 +1041,10 @@ def draw_grid(self, axes=None, grid_spacing=15*u.deg, **kwargs):

if not axes:
axes = wcsaxes_compat.gca_wcs(self.wcs)

# Do not automatically rescale axes when plotting the overlay
axes.set_autoscale_on(False)

transform = wcsaxes_compat.get_world_transform(axes)

XX, YY = np.meshgrid(np.arange(self.data.shape[0]),
Expand Down Expand Up @@ -1091,10 +1095,8 @@ def draw_grid(self, axes=None, grid_spacing=15*u.deg, **kwargs):
y = (y*u.arcsec).to(u.deg).value
axes.plot(x, y, **plot_kw)

if not wcsaxes_compat.is_wcsaxes(axes):
axes.set_ylim(self.yrange.value)
axes.set_xlim(self.xrange.value)

# Turn autoscaling back on.
axes.set_autoscale_on(True)
return axes

def draw_limb(self, axes=None, **kwargs):
Expand Down Expand Up @@ -1173,7 +1175,7 @@ def peek(self, draw_limb=False, draw_grid=False, gamma=None,

# Normal plot
else:
axes = figure.gca()
axes = wcsaxes_compat.gca_wcs(self.wcs)

im = self.plot(axes=axes, **matplot_args)

Expand Down
3 changes: 3 additions & 0 deletions sunpy/visualization/wcsaxes_compat.py
Expand Up @@ -78,6 +78,9 @@ def default_wcs_grid(axes):
x = axes.coords[0]
y = axes.coords[1]

x.set_ticks(color='white')
y.set_ticks(color='white')

x.set_ticks_position('bl')
y.set_ticks_position('bl')

Expand Down

0 comments on commit 966cd17

Please sign in to comment.