diff --git a/tbox/utils.py b/tbox/utils.py index 73ec554d506fbd70468392746b5890de2e38da2c..01ba3c9dee6beffe19f7d2186128803419d5e5d3 100644 --- a/tbox/utils.py +++ b/tbox/utils.py @@ -34,28 +34,25 @@ def myrange(start, stop, step): def plot(x, y, cfg): """Plot using matplotlib """ - from fwk.wutils import parseargs - args = parseargs() - if not args.nogui: - import matplotlib.pyplot as plt - # define font - font = {'family': 'serif', 'color': 'darkred', 'weight': 'normal', 'size': 16} - # plot results - plt.plot(x, y, 'b-', lw=2) - if 'xlabel' in cfg: - plt.xlabel(cfg['xlabel'], fontdict=font) - if 'ylabel' in cfg: - plt.ylabel(cfg['ylabel'], fontdict=font) - if 'title' in cfg: - plt.title(cfg['title'], fontdict=font) - if 'xlim' in cfg: - plt.xlim(cfg['xlim']) - if 'ylim' in cfg: - plt.ylim(cfg['ylim']) - if 'invert' in cfg and cfg['invert']: - plt.gca().invert_yaxis() - # display - plt.show() + import matplotlib.pyplot as plt + # define font + font = {'family': 'serif', 'color': 'darkred', 'weight': 'normal', 'size': 16} + # plot results + plt.plot(x, y, 'b-', lw=2) + if 'xlabel' in cfg: + plt.xlabel(cfg['xlabel'], fontdict=font) + if 'ylabel' in cfg: + plt.ylabel(cfg['ylabel'], fontdict=font) + if 'title' in cfg: + plt.title(cfg['title'], fontdict=font) + if 'xlim' in cfg: + plt.xlim(cfg['xlim']) + if 'ylim' in cfg: + plt.ylim(cfg['ylim']) + if 'invert' in cfg and cfg['invert']: + plt.gca().invert_yaxis() + # display + plt.show() def sort(id, data): """Sort data array against id (line connectivity list)