Commit 0a6c758b authored by Kris Vanneste's avatar Kris Vanneste
Browse files

Remove horizontal/vertical label alignment for parallels/meridians in...

Remove horizontal/vertical label alignment for parallels/meridians in draw_graticule method of LayeredBasemap to solve ugly label alignment in newer versions of Basemap.

git-svn-id: https://svn.seismo.oma.be/svn/seismo/mapping/layeredbasemap/trunk@6892 40b490c5-b4d9-47cb-8714-9bef99b524d5
parent 3a41249b
...@@ -2047,17 +2047,21 @@ class LayeredBasemap: ...@@ -2047,17 +2047,21 @@ class LayeredBasemap:
if self.dlon != None: if self.dlon != None:
meridian_style = self.graticule_style.copy() meridian_style = self.graticule_style.copy()
meridian_style.annot_axes = meridian_style.annot_axes.replace('W', '').replace('E', '') meridian_style.annot_axes = meridian_style.annot_axes.replace('W', '').replace('E', '')
style_kwargs = meridian_style.to_kwargs()
style_kwargs.pop('va', None)
first_meridian = np.ceil(self.region[0] / self.dlon) * self.dlon first_meridian = np.ceil(self.region[0] / self.dlon) * self.dlon
last_meridian = np.floor(self.region[1] / self.dlon) * self.dlon + self.dlon last_meridian = np.floor(self.region[1] / self.dlon) * self.dlon + self.dlon
meridians = np.arange(first_meridian, last_meridian, self.dlon) meridians = np.arange(first_meridian, last_meridian, self.dlon)
self.map.drawmeridians(meridians, zorder=self.zorder, **meridian_style.to_kwargs()) self.map.drawmeridians(meridians, zorder=self.zorder, **style_kwargs)
if self.dlat != None: if self.dlat != None:
parallel_style = self.graticule_style.copy() parallel_style = self.graticule_style.copy()
parallel_style.annot_axes = parallel_style.annot_axes.replace('N', '').replace('S', '') parallel_style.annot_axes = parallel_style.annot_axes.replace('N', '').replace('S', '')
style_kwargs = parallel_style.to_kwargs()
style_kwargs.pop('ha', None)
first_parallel = np.ceil(self.region[2] / self.dlat) * self.dlat first_parallel = np.ceil(self.region[2] / self.dlat) * self.dlat
last_parallel = np.floor(self.region[3] / self.dlat) * self.dlat + self.dlat last_parallel = np.floor(self.region[3] / self.dlat) * self.dlat + self.dlat
parallels = np.arange(first_parallel, last_parallel, self.dlat) parallels = np.arange(first_parallel, last_parallel, self.dlat)
self.map.drawparallels(parallels, zorder=self.zorder, **parallel_style.to_kwargs()) self.map.drawparallels(parallels, zorder=self.zorder, **style_kwargs)
self.zorder += 1 self.zorder += 1
def draw_scalebar(self): def draw_scalebar(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment