Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLASdataprocessing
Commits
b5c1ae4c
Commit
b5c1ae4c
authored
Jan 10, 2018
by
Markus Mirz
Browse files
added legend location as parameter
parent
70b1a1fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
dataprocessing/plottools.py
View file @
b5c1ae4c
...
...
@@ -3,7 +3,7 @@ import numpy as np
from
.timeseries
import
*
def
plot_timeseries
(
figure_id
,
timeseries
,
plt_linestyle
=
'-'
,
plt_linewidth
=
2
,
plt_color
=
None
):
def
plot_timeseries
(
figure_id
,
timeseries
,
plt_linestyle
=
'-'
,
plt_linewidth
=
2
,
plt_color
=
None
,
plt_legend_loc
=
'lower right'
):
"""
This function plots either a single timeseries or several timeseries in the figure defined by figure_id.
Several timeseries (handed over in a list) are plotted in several subplots.
...
...
@@ -16,7 +16,7 @@ def plot_timeseries(figure_id, timeseries, plt_linestyle='-', plt_linewidth=2, p
else
:
plt
.
plot
(
timeseries
.
time
,
timeseries
.
values
,
linestyle
=
plt_linestyle
,
label
=
timeseries
.
label
,
linewidth
=
plt_linewidth
)
plt
.
gca
().
autoscale
(
axis
=
'x'
,
tight
=
True
)
plt
.
legend
(
loc
=
'lower right'
)
plt
.
legend
(
loc
=
plt_legend_loc
)
else
:
for
ts
in
timeseries
:
plt
.
subplot
(
len
(
timeseries
),
1
,
timeseries
.
index
(
ts
)
+
1
)
...
...
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