Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
5cb00a5b
Commit
5cb00a5b
authored
Feb 12, 2019
by
thomas.forbriger
Browse files
proposp [WP]: set legend font size in plots
parent
a8f3a78b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ts/croposp/croposplot.py
View file @
5cb00a5b
...
...
@@ -59,6 +59,7 @@ def usage():
print
(
__version__
)
print
(
'Usage: '
+
sys
.
argv
[
0
]
+
' [-v]'
)
print
(
' [-o file] [-g|--grid] [--nologlog] [--nologx] [--nology]'
)
print
(
' [--lfontsize s]'
)
print
(
' file [file [file ...]]'
)
print
(
' or: '
+
sys
.
argv
[
0
]
+
' --help|-h'
)
...
...
@@ -82,6 +83,7 @@ def help():
--nologlog plot on linear scales
--nologx use linear scale for x-axis
--nology use linear scale for y-axis
--lfontsize s set font size for legend
"""
)
# ============================================================================
...
...
@@ -96,7 +98,7 @@ def main(argv=None):
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hvo:g'
,
[
'help'
,
'nologlog'
,
'nologx'
,
'nology'
,
'grid'
,
'xlabel'
])
'nologx'
,
'nology'
,
'grid'
,
'xlabel'
,
'lfontsize'
])
except
getopt
.
GetoptError
as
err
:
print
(
err
.
msg
)
exit
(
0
)
...
...
@@ -110,6 +112,7 @@ def main(argv=None):
nology
=
False
grid
=
False
xlabel
=
'frequency / Hz'
opt_legendfontsize
=
'xx-small'
for
(
opt
,
arg
)
in
opts
:
if
opt
==
'-v'
:
...
...
@@ -120,6 +123,8 @@ def main(argv=None):
outfile
=
arg
elif
opt
in
(
'--xlabel'
):
xlabel
=
arg
elif
opt
in
(
'--lfontsize'
):
opt_legendfontsize
=
arg
elif
opt
in
(
"-g"
,
"--grid"
):
grid
=
True
elif
opt
in
(
"--nologlog"
):
...
...
@@ -184,7 +189,7 @@ def main(argv=None):
if
verbose
:
print
(
'plot curve %d: %s'
%
(
i
,
label
))
plt
.
plot
(
data
[:,
0
],
data
[:,
i
],
label
=
label
)
plt
.
legend
()
plt
.
legend
(
fontsize
=
opt_legendfontsize
)
if
outfile
==
'x11'
:
plt
.
show
(
True
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment