Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Detection eddies
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
IPSL
LMD
DPAO
Detection eddies
Commits
95638923
Commit
95638923
authored
1 year ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Use OO-style
parent
032dea79
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
Inst_eddies/Analysis/distribution_function.py
+10
-10
10 additions, 10 deletions
Inst_eddies/Analysis/distribution_function.py
with
10 additions
and
10 deletions
Inst_eddies/Analysis/distribution_function.py
+
10
−
10
View file @
95638923
...
@@ -62,11 +62,11 @@ def fig_hist(xlabel, x, label):
...
@@ -62,11 +62,11 @@ def fig_hist(xlabel, x, label):
"""
Creates a complete figure with histogram. x and label can also be
"""
Creates a complete figure with histogram. x and label can also be
sequences.
"""
sequences.
"""
plt
.
figure
()
fig
,
ax
=
plt
.
subplots
()
plt
.
hist
(
x
,
bins
=
"
auto
"
,
histtype
=
"
step
"
,
label
=
label
)
ax
.
hist
(
x
,
bins
=
"
auto
"
,
histtype
=
"
step
"
,
label
=
label
)
plt
.
xlabel
(
xlabel
)
ax
.
set_
xlabel
(
xlabel
)
plt
.
ylabel
(
"
number of occurrences
"
)
ax
.
set_
ylabel
(
"
number of occurrences
"
)
if
label
is
not
None
:
plt
.
legend
()
if
label
is
not
None
:
ax
.
legend
()
def
fig_distr_funct
(
xlabel
,
x
,
label
=
None
):
def
fig_distr_funct
(
xlabel
,
x
,
label
=
None
):
"""
Creates a complete figure with distribution function. x must be a
"""
Creates a complete figure with distribution function. x must be a
...
@@ -74,18 +74,18 @@ def fig_distr_funct(xlabel, x, label = None):
...
@@ -74,18 +74,18 @@ def fig_distr_funct(xlabel, x, label = None):
"""
"""
plt
.
figure
()
fig
,
ax
=
plt
.
subplots
()
print
(
xlabel
+
"
:
"
)
print
(
xlabel
+
"
:
"
)
label_None
=
label
is
None
label_None
=
label
is
None
if
label_None
:
label
=
itertools
.
repeat
(
None
)
if
label_None
:
label
=
itertools
.
repeat
(
None
)
for
xi
,
li
in
zip
(
x
,
label
):
for
xi
,
li
in
zip
(
x
,
label
):
plot_distr_funct
(
xi
,
l
abel
=
li
)
plot_distr_funct
(
xi
,
l
i
,
ax
)
plt
.
xlabel
(
xlabel
)
ax
.
set_
xlabel
(
xlabel
)
plt
.
ylabel
(
"
distribution function
"
)
ax
.
set_
ylabel
(
"
distribution function
"
)
if
not
label_None
:
plt
.
legend
()
if
not
label_None
:
ax
.
legend
()
def
plot_all
(
dict_list
,
label
=
None
):
def
plot_all
(
dict_list
,
label
=
None
):
"""
dict_list: list of dictionaries. label: list of labels, one label
"""
dict_list: list of dictionaries. label: list of labels, one label
...
...
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