Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
predihood
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duchateau Fabien
predihood
Commits
71599410
Commit
71599410
authored
5 years ago
by
Nelly Barret
Browse files
Options
Downloads
Patches
Plain Diff
[M] generating figure with 12 subplots
parent
c3c3f76e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
predihood/classes/Chart.py
+19
-11
19 additions, 11 deletions
predihood/classes/Chart.py
with
19 additions
and
11 deletions
predihood/classes/Chart.py
+
19
−
11
View file @
71599410
...
...
@@ -13,22 +13,30 @@ class Chart(Method):
self
.
dataset
=
dataset
self
.
trendline
=
None
def
compute_trendline
(
self
):
# TODO: check order of selected indicators
def
compute_trendline
(
self
):
# TODO: check order of selected indicators
print
(
"
compute trendline
"
)
# for indicator in self.dataset.selected_indicators:
for
index
,
row
in
self
.
dataset
.
data
.
head
(
7
).
iterrows
():
fig
,
axs
=
plt
.
subplots
(
6
,
2
,
figsize
=
(
15
,
15
))
# rows, columns
i
,
j
,
k
=
0
,
0
,
1
# i and j are indices to plot sub-figures and k is the counter to place figures
for
index
,
row
in
self
.
dataset
.
data
.
head
(
12
).
iterrows
():
data
=
[]
for
indicator
in
self
.
dataset
.
selected_indicators
:
print
(
index
,
"
-
"
,
row
[
indicator
])
data
.
append
(
row
[
indicator
])
max_value
=
self
.
dataset
.
data
.
head
(
11
)[
self
.
dataset
.
selected_indicators
].
values
.
max
()
print
(
max_value
)
max_value
=
self
.
dataset
.
data
.
head
(
12
)[
self
.
dataset
.
selected_indicators
].
values
.
max
()
x
=
np
.
arange
(
0
,
len
(
data
))
y
=
data
f
=
interp1d
(
x
,
y
)
plt
.
ylim
([
0
,
max_value
])
plt
.
xticks
(
np
.
arange
(
0
,
len
(
data
)),
self
.
dataset
.
selected_indicators
,
rotation
=
90
)
plt
.
yticks
(
np
.
arange
(
0
,
max_value
,
step
=
max_value
/
5
))
plt
.
plot
(
x
,
data
,
'
o
'
,
x
,
f
(
x
),
'
-
'
)
plt
.
title
(
str
(
row
[
'
CODE
'
])
+
"
-
"
+
self
.
dataset
.
env
)
plt
.
show
()
axs
[
i
,
j
].
axis
(
ymin
=
0
,
ymax
=
max_value
)
axs
[
i
,
j
].
set_xticks
(
np
.
arange
(
0
,
len
(
data
)))
axs
[
i
,
j
].
set_xticks
(
np
.
arange
(
0
,
max_value
,
step
=
max_value
/
5
))
axs
[
i
,
j
].
plot
(
x
,
data
,
'
o
'
,
x
,
f
(
x
),
'
-
'
)
title
=
str
(
row
[
'
CODE
'
])
+
"
-
"
+
str
(
self
.
dataset
.
env
)
axs
[
i
,
j
].
set_title
(
title
)
if
k
<
2
:
k
+=
1
j
+=
1
else
:
k
=
1
i
+=
1
j
=
0
fig
.
show
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment