Commit 1a154eb5 authored by Stefan Mauerberger's avatar Stefan Mauerberger
Browse files

Use non-blocking draw()

parent ce249be1
...@@ -32,6 +32,7 @@ import argparse ...@@ -32,6 +32,7 @@ import argparse
from . import commands from . import commands
from pymagglobal import models from pymagglobal import models
from pymagglobal import __version__ from pymagglobal import __version__
from matplotlib import pyplot as plt
class ListModelsAction(argparse.Action): class ListModelsAction(argparse.Action):
...@@ -202,6 +203,8 @@ def main(): ...@@ -202,6 +203,8 @@ def main():
# call the respective function, specified using .set_defaults(func=...) # call the respective function, specified using .set_defaults(func=...)
args.func(args) args.func(args)
if not args.no_show:
plt.show()
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -174,7 +174,7 @@ def master_curve(args): ...@@ -174,7 +174,7 @@ def master_curve(args):
else: else:
axs[it].set_xlabel(utils.nicelabel(args.t_label)) axs[it].set_xlabel(utils.nicelabel(args.t_label))
fig.tight_layout(rect=[0, 0.03, 1, 0.95]) fig.tight_layout(rect=[0, 0.03, 1, 0.95])
plt.show() plt.draw()
def dipole_series(args): def dipole_series(args):
...@@ -220,7 +220,7 @@ def dipole_series(args): ...@@ -220,7 +220,7 @@ def dipole_series(args):
else: else:
ax.set_xlabel(utils.nicelabel(args.t_label)) ax.set_xlabel(utils.nicelabel(args.t_label))
fig.tight_layout() fig.tight_layout()
plt.show() plt.draw()
def coefficients(args): def coefficients(args):
...@@ -353,4 +353,4 @@ def maps(args): ...@@ -353,4 +353,4 @@ def maps(args):
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmaps[it]), fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmaps[it]),
cax=colax, cax=colax,
orientation='horizontal') orientation='horizontal')
plt.show() plt.draw()
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