automap: allow croping of output, reduce number of ticks

feature/jackseis-scale-option
hvasbath 2 years ago
parent d0fffc3c03
commit 47eb2f0a70

@ -199,7 +199,7 @@ class Map(Object):
self._gmtversion = gmtversion
def save(self, outpath, resolution=75., oversample=2., size=None,
width=None, height=None, psconvert=False):
width=None, height=None, psconvert=False, crop_eps_mode=False):
'''
Save the image.
@ -226,6 +226,7 @@ class Map(Object):
self._draw_topo_scale()
gmt.save(outpath, resolution=resolution, oversample=oversample,
crop_eps_mode=crop_eps_mode,
size=size, width=width, height=height, psconvert=psconvert)
@property
@ -308,8 +309,8 @@ class Map(Object):
x, y, z = ((west, east), (south, north), (-6000., 4500.))
xax = gmtpy.Ax(mode='min-max', approx_ticks=4.)
yax = gmtpy.Ax(mode='min-max', approx_ticks=4.)
xax = gmtpy.Ax(mode='min-max', approx_ticks=3.)
yax = gmtpy.Ax(mode='min-max', approx_ticks=3.)
zax = gmtpy.Ax(mode='min-max', inc=1000., label='Height',
scaled_unit='km', scaled_unit_factor=0.001)

@ -3727,7 +3727,7 @@ class GMT(object):
if self.is_gmt5():
if crop_eps_mode:
addarg = ['-A0']
addarg = ['-A']
else:
addarg = []
@ -3752,7 +3752,7 @@ class GMT(object):
elif filename.endswith('.pdf'):
if psconvert:
gmt_bin = pjoin(self.installation['bin'], 'gmt')
subprocess.call([gmt_bin, 'psconvert', tempfn, '-Tf',
subprocess.call([gmt_bin, 'psconvert', tempfn + '.eps', '-Tf',
'-F' + filename])
else:
subprocess.call(['gmtpy-epstopdf', '--res=%i' % resolution,

Loading…
Cancel
Save