Commit 065c3087 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

croposp [WP]: let croposplot print title

parent 6d7adcf9
......@@ -59,7 +59,7 @@ def usage():
print(__version__)
print('Usage: '+sys.argv[0]+' [-v]')
print(' [-o file] [-g|--grid] [--nologlog] [--nologx] [--nology]')
print(' [--lfontsize s]')
print(' [--lfontsize s] [--title t]')
print(' file [file [file ...]]')
print(' or: '+sys.argv[0]+' --help|-h')
......@@ -84,6 +84,7 @@ def help():
--nologx use linear scale for x-axis
--nology use linear scale for y-axis
--lfontsize s set font size for legend
--title t set plot title
""")
# ============================================================================
......@@ -98,7 +99,7 @@ def main(argv=None):
try:
opts, args=getopt.getopt(sys.argv[1:], 'hvo:g', ['help', 'nologlog',
'nologx', 'nology', 'grid', 'xlabel', 'lfontsize'])
'nologx', 'nology', 'grid', 'xlabel=', 'lfontsize=', 'title='])
except getopt.GetoptError as err:
print(err.msg)
exit(0)
......@@ -113,6 +114,7 @@ def main(argv=None):
grid = False
xlabel = 'frequency / Hz'
opt_legendfontsize='xx-small'
opt_title = None
for (opt, arg) in opts:
if opt == '-v':
......@@ -125,6 +127,8 @@ def main(argv=None):
xlabel=arg
elif opt in ('--lfontsize'):
opt_legendfontsize=arg
elif opt in ('--title'):
opt_title=arg
elif opt in ("-g", "--grid"):
grid = True
elif opt in ("--nologlog"):
......@@ -191,6 +195,9 @@ def main(argv=None):
plt.plot(data[:,0], data[:,i], label=label)
plt.legend(fontsize=opt_legendfontsize)
if opt_title is not None:
plt.title(opt_title)
if outfile=='x11':
plt.show(True)
else:
......
Markdown is supported
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