Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ITCPG.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Stuermer
ITCPG.jl
Commits
d7421794
Commit
d7421794
authored
4 years ago
by
Julian Stürmer
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes in plotting functions
parent
9ed616a0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/PlotImpact.jl
+12
-8
12 additions, 8 deletions
src/PlotImpact.jl
with
12 additions
and
8 deletions
src/PlotImpact.jl
+
12
−
8
View file @
d7421794
...
...
@@ -6,8 +6,8 @@ Plots histograms of the number of line failures for given values of γ
=#
function
plothist_tl_failures
(
γ_values
::
Array
{
Float64
,
1
},
N_runs
::
Int64
,
rstep
=
20
;
# number of realizations that were saved together
N_runs
::
Int64
;
rstep
=
20
,
# number of realizations that were saved together
datapath
=
""
,
# path to folder containing different γ scans
plotpath
=
""
# where to save the plot
)
...
...
@@ -35,15 +35,17 @@ function plothist_tl_failures(
γ
::
Float64
,
N_runs
::
Int64
,
rstep
=
20
;
# number of realizations that were saved together
datapath
::
String
,
# path to folder containing data files
plotpath
::
String
# where to save the plot
datapath
=
""
,
# path to folder containing data files
plotpath
=
""
,
# where to save the plot
)
Nf
=
zeros
(
Int64
,
N_runs
)
# array for number of failures
### Read data and save the number of failures that occured in each run
for
i
in
rstep
:
rstep
:
N_runs
res
=
load
(
datapath
*
"gamma
$
γ/"
*
"results_
$
γ"
*
"_
$
i.jld2"
,
"result"
)
res
=
load
(
datapath
*
"Ike_impact_gamma
$
γ/scan_data/"
*
"tl_failures_gamma
$
γ"
*
"_n
$
(i-rstep+1)_to_n
$
i.jld2"
,
"result"
)
for
j
in
1
:
rstep
Nf
[
i
-
rstep
+
j
]
=
length
(
res
[
j
])
end
...
...
@@ -64,7 +66,7 @@ function plothist_tl_failures(
[
no_marker
for
i
in
1
:
4
],
[
L"γ = "
*
"
$
γ"
,
L"N_r = "
*
"
$
N_runs"
,
L"
\b
ar{N}_\mathrm{f}
\a
pprox"
*
"
$
mean_Nf"
,
L"\
wide
bar{N}_\mathrm{f}
\a
pprox"
*
"
$
mean_Nf"
,
L"\sigma_\mathrm{f}
\a
pprox"
*
"
$
σ"
],
handletextpad
=
0
,
handlelength
=
0
)
...
...
@@ -74,8 +76,10 @@ function plothist_tl_failures(
plt
.
ylabel
(
"Frequency"
)
### Save and close figure
figpath
=
plotpath
*
"Texas_hist_tl_failures_gamma
$
γ.png"
plt
.
savefig
(
figpath
,
bbox_inches
=
"tight"
)
if
isempty
(
plotpath
)
==
false
figpath
=
plotpath
*
"gamma
$
γ.png"
plt
.
savefig
(
figpath
,
bbox_inches
=
"tight"
)
end
plt
.
clf
()
return
mean_Nf
,
σ
...
...
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