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):
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)
......
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