Commit c14a72f9 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

croposp [FEATURE]: support portrait orinetation in croposplot

parent 0086ac39
......@@ -62,7 +62,7 @@ def usage():
print(' [-o file] [-g|--grid] [--nologlog] [--nologx] [--nology]')
print(' [--legfontsize s] [--legpos p] [--title t]')
print(' [--xlabel l] [--ylabel l] [--titfontsize t]')
print(' [--xlim l] [--ylim l]')
print(' [--xlim l] [--ylim l] [--portrait]')
print(' [--usemarkers] [--match re]')
print(' file [file [file ...]]')
print(' or: '+sys.argv[0]+' --help|-h')
......@@ -85,6 +85,7 @@ def help():
--xlabel l set label "l" on x-axis
--ylabel l set label "l" on y-axis
-g|--grid plot grid
--portrait use protrait orientation (default: landscape)
--nologlog plot on linear scales
--nologx use linear scale for x-axis
--nology use linear scale for y-axis
......@@ -122,7 +123,7 @@ def main(argv=None):
opts, args=getopt.getopt(sys.argv[1:], 'hvo:g', ['help', 'nologlog',
'nologx', 'nology', 'grid', 'xlabel=', 'legfontsize=', 'title=',
'legpos=', 'titfontsize=', 'ylabel=', 'xlim=', 'ylim=',
'usemarkers', 'match='])
'usemarkers', 'match=', 'portrait'])
except getopt.GetoptError as err:
print(err.msg)
exit(0)
......@@ -145,6 +146,7 @@ def main(argv=None):
opt_ylim = None
opt_usemarkers = False
opt_match = None
opt_orientation='landscape'
for (opt, arg) in opts:
if opt == '-v':
......@@ -183,6 +185,8 @@ def main(argv=None):
opt_title=arg
elif opt in ("-g", "--grid"):
grid = True
elif opt in ("--portrait"):
opt_orientation = 'portrait'
elif opt in ("--nologlog"):
nologlog = True
elif opt in ("--nologx"):
......@@ -210,6 +214,9 @@ def main(argv=None):
print("Read croposp output files and create diagram")
Figure=plt.figure()
if opt_orientation is 'portrait':
Figure.set_figheight(10.)
Figure.set_figwidth(7.5)
plt.grid(grid)
# using logscale if desired
......@@ -286,7 +293,7 @@ def main(argv=None):
if outfile=='x11':
plt.show(True)
else:
plt.savefig(outfile, papertype='a4', orientation='landscape')
plt.savefig(outfile, papertype='a4', orientation=opt_orientation)
return 0
......
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