Skip to content
Snippets Groups Projects
Commit 348dbe9e authored by Adrien Crovato's avatar Adrien Crovato
Browse files

Remove custom parser from utils

parent e3b7f5ec
No related branches found
No related tags found
1 merge request!11amfe v1.0.7
Pipeline #16817 passed
...@@ -34,28 +34,25 @@ def myrange(start, stop, step): ...@@ -34,28 +34,25 @@ def myrange(start, stop, step):
def plot(x, y, cfg): def plot(x, y, cfg):
"""Plot using matplotlib """Plot using matplotlib
""" """
from fwk.wutils import parseargs import matplotlib.pyplot as plt
args = parseargs() # define font
if not args.nogui: font = {'family': 'serif', 'color': 'darkred', 'weight': 'normal', 'size': 16}
import matplotlib.pyplot as plt # plot results
# define font plt.plot(x, y, 'b-', lw=2)
font = {'family': 'serif', 'color': 'darkred', 'weight': 'normal', 'size': 16} if 'xlabel' in cfg:
# plot results plt.xlabel(cfg['xlabel'], fontdict=font)
plt.plot(x, y, 'b-', lw=2) if 'ylabel' in cfg:
if 'xlabel' in cfg: plt.ylabel(cfg['ylabel'], fontdict=font)
plt.xlabel(cfg['xlabel'], fontdict=font) if 'title' in cfg:
if 'ylabel' in cfg: plt.title(cfg['title'], fontdict=font)
plt.ylabel(cfg['ylabel'], fontdict=font) if 'xlim' in cfg:
if 'title' in cfg: plt.xlim(cfg['xlim'])
plt.title(cfg['title'], fontdict=font) if 'ylim' in cfg:
if 'xlim' in cfg: plt.ylim(cfg['ylim'])
plt.xlim(cfg['xlim']) if 'invert' in cfg and cfg['invert']:
if 'ylim' in cfg: plt.gca().invert_yaxis()
plt.ylim(cfg['ylim']) # display
if 'invert' in cfg and cfg['invert']: plt.show()
plt.gca().invert_yaxis()
# display
plt.show()
def sort(id, data): def sort(id, data):
"""Sort data array against id (line connectivity list) """Sort data array against id (line connectivity list)
......
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