Skip to content
Snippets Groups Projects
Commit 7774dacc authored by Christoph Groth's avatar Christoph Groth
Browse files

get rid of an ugly MATLABism

parent 63d101fe
No related branches found
No related tags found
No related merge requests found
...@@ -1253,12 +1253,12 @@ def plot(sys, num_lead_cells=2, unit='nn', ...@@ -1253,12 +1253,12 @@ def plot(sys, num_lead_cells=2, unit='nn',
fig.set_figheight(fig_size[1]) fig.set_figheight(fig_size[1])
if dim == 2: if dim == 2:
ax = fig.add_subplot(111, aspect='equal', adjustable='datalim') ax = fig.add_subplot(1, 1, 1, aspect='equal', adjustable='datalim')
ax.set_xmargin(0.05) ax.set_xmargin(0.05)
ax.set_ymargin(0.05) ax.set_ymargin(0.05)
else: else:
warnings.filterwarnings('ignore', message=r'.*rotation.*') warnings.filterwarnings('ignore', message=r'.*rotation.*')
ax = fig.add_subplot(111, projection='3d') ax = fig.add_subplot(1, 1, 1, projection='3d')
warnings.resetwarnings() warnings.resetwarnings()
else: else:
fig = None fig = None
...@@ -1472,7 +1472,7 @@ def map(sys, value, colorbar=True, cmap=None, vmin=None, vmax=None, a=None, ...@@ -1472,7 +1472,7 @@ def map(sys, value, colorbar=True, cmap=None, vmin=None, vmax=None, a=None,
if fig_size is not None: if fig_size is not None:
fig.set_figwidth(fig_size[0]) fig.set_figwidth(fig_size[0])
fig.set_figheight(fig_size[1]) fig.set_figheight(fig_size[1])
ax = fig.add_subplot(111, aspect='equal', adjustable='datalim') ax = fig.add_subplot(1, 1, 1, aspect='equal', adjustable='datalim')
# Note that we tell imshow to show the array created by mask_interpolate # Note that we tell imshow to show the array created by mask_interpolate
# faithfully and not to interpolate by itself another time. # faithfully and not to interpolate by itself another time.
...@@ -1536,7 +1536,7 @@ def bands(sys, momenta=65, args=(), file=None, show=True, dpi=None, ...@@ -1536,7 +1536,7 @@ def bands(sys, momenta=65, args=(), file=None, show=True, dpi=None,
if fig_size is not None: if fig_size is not None:
fig.set_figwidth(fig_size[0]) fig.set_figwidth(fig_size[0])
fig.set_figheight(fig_size[1]) fig.set_figheight(fig_size[1])
ax = fig.add_subplot(111) ax = fig.add_subplot(1, 1, 1)
ax.plot(momenta, energies) ax.plot(momenta, energies)
return output_fig(fig, file=file, show=show) return output_fig(fig, file=file, show=show)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment