From 966cd17c2fe0035cfacbc8338b4e59b933b13139 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Sat, 16 May 2015 14:10:46 +0100 Subject: [PATCH] Plotting tweaks --- sunpy/map/mapbase.py | 12 +++++++----- sunpy/visualization/wcsaxes_compat.py | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py index 657200937a6..12a3f8f568b 100644 --- a/sunpy/map/mapbase.py +++ b/sunpy/map/mapbase.py @@ -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]), @@ -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): @@ -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) diff --git a/sunpy/visualization/wcsaxes_compat.py b/sunpy/visualization/wcsaxes_compat.py index c10c2c1b429..0bf4f5050d2 100644 --- a/sunpy/visualization/wcsaxes_compat.py +++ b/sunpy/visualization/wcsaxes_compat.py @@ -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')