Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitor-NaviX
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
Container registry
Model registry
Operate
Environments
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
ETP-HTC
monitor-NaviX
Commits
166e65f7
Commit
166e65f7
authored
6 years ago
by
Martin Sauter
Browse files
Options
Downloads
Patches
Plain Diff
* changed dpi of plots
* changed size of plots * changed location of legend in plots
parent
bea983c1
Branches
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
navimon/NaviPlotFunctions.py
+53
-23
53 additions, 23 deletions
navimon/NaviPlotFunctions.py
with
53 additions
and
23 deletions
navimon/NaviPlotFunctions.py
+
53
−
23
View file @
166e65f7
...
...
@@ -14,7 +14,7 @@ def set_general_style(n_colors=11):
def
plot_1d_hist
(
data_frame_list
,
weights_list
,
label_list
,
title
=
''
,
x_label
=
''
,
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
legend_loc
=
'
bes
t
'
,
style
=
'
step
'
,
export_as
=
'
.pdf
'
):
show_plot
=
True
,
save_plot
=
True
,
legend_loc
=
'
center lef
t
'
,
style
=
'
step
'
,
export_as
=
'
.pdf
'
,
dpi
=
500
):
print
(
'
###################################################################################################
'
)
print
(
'
Plotting:
'
+
title
)
print
(
'
---------------------------------------------------------------------------------------------------
'
)
...
...
@@ -50,21 +50,25 @@ def plot_1d_hist(data_frame_list, weights_list, label_list, title='', x_label=''
plt
.
xscale
(
'
log
'
)
if
y_log
:
plt
.
yscale
(
'
log
'
)
legend
=
ax1
.
legend
(
loc
=
legend_loc
,
numpoints
=
1
,
frameon
=
True
,
framealpha
=
1.0
)
legend
.
get_frame
().
set_facecolor
(
'
white
'
)
plt
.
title
(
title
)
box
=
ax1
.
get_position
()
ax1
.
set_position
([
box
.
x0
,
box
.
y0
,
box
.
width
*
0.8
,
box
.
height
])
ax1
.
legend
(
loc
=
legend_loc
,
framealpha
=
1.0
,
numpoints
=
1
,
frameon
=
True
,
bbox_to_anchor
=
(
1
,
0.5
))
fig
.
suptitle
(
title
,
fontsize
=
12
)
fig
.
set_size_inches
(
8
,
4.5
)
if
show_plot
:
plt
.
show
()
if
save_plot
:
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
)
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
,
dpi
=
dpi
)
plt
.
close
()
return
def
plot_2d_line
(
x_array_list
,
y_array_list
,
label_list
,
title
=
''
,
x_label
=
''
,
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
style
=
''
,
export_as
=
'
.pdf
'
):
show_plot
=
True
,
save_plot
=
True
,
style
=
''
,
export_as
=
'
.pdf
'
,
dpi
=
500
):
print
(
'
###################################################################################################
'
)
print
(
'
Plotting:
'
+
title
)
print
(
'
---------------------------------------------------------------------------------------------------
'
)
...
...
@@ -98,21 +102,26 @@ def plot_2d_line(x_array_list, y_array_list, label_list, title='', x_label='', y
if
y_log
:
plt
.
yscale
(
'
log
'
)
if
not
label_list
[
0
]
==
''
:
legend
=
ax1
.
legend
(
loc
=
'
best
'
,
numpoints
=
1
,
frameon
=
True
,
framealpha
=
1.0
)
legend
.
get_frame
().
set_facecolor
(
'
white
'
)
plt
.
title
(
title
)
# legend = ax1.legend(loc='best', numpoints=1, frameon=True, framealpha=1.0)
# legend.get_frame().set_facecolor('white')
box
=
ax1
.
get_position
()
ax1
.
set_position
([
box
.
x0
,
box
.
y0
,
box
.
width
*
0.8
,
box
.
height
])
ax1
.
legend
(
loc
=
'
center left
'
,
framealpha
=
1.0
,
numpoints
=
1
,
frameon
=
True
,
bbox_to_anchor
=
(
1
,
0.5
))
fig
.
suptitle
(
title
,
fontsize
=
12
)
fig
.
set_size_inches
(
8
,
4.5
)
if
show_plot
:
plt
.
show
()
if
save_plot
:
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
)
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
,
dpi
=
dpi
)
plt
.
close
()
return
def
plot_2d_error
(
x_array_list
,
y_array_list
,
x_std_array_list
,
y_std_array_list
,
label_list
,
title
=
''
,
x_label
=
''
,
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
export_as
=
'
.pdf
'
):
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
export_as
=
'
.pdf
'
,
dpi
=
500
):
print
(
'
###################################################################################################
'
)
print
(
'
Plotting:
'
+
title
)
print
(
'
---------------------------------------------------------------------------------------------------
'
)
...
...
@@ -130,21 +139,25 @@ def plot_2d_error(x_array_list, y_array_list, x_std_array_list, y_std_array_list
if
y_log
:
plt
.
yscale
(
'
log
'
)
if
not
label_list
[
0
]
==
''
:
legend
=
ax1
.
legend
(
loc
=
'
best
'
,
numpoints
=
1
,
frameon
=
True
,
framealpha
=
1.0
)
box
=
ax1
.
get_position
()
ax1
.
set_position
([
box
.
x0
,
box
.
y0
,
box
.
width
*
0.8
,
box
.
height
])
legend
=
ax1
.
legend
(
loc
=
'
center left
'
,
framealpha
=
1.0
,
numpoints
=
1
,
frameon
=
True
,
bbox_to_anchor
=
(
1
,
0.5
))
legend
.
get_frame
().
set_facecolor
(
'
white
'
)
plt
.
title
(
title
)
fig
.
suptitle
(
title
,
fontsize
=
12
)
fig
.
set_size_inches
(
8
,
4.5
)
if
show_plot
:
plt
.
show
()
if
save_plot
:
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
)
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
,
dpi
=
dpi
)
plt
.
close
()
return
def
plot_2d_scatter_old
(
data_frame_list
,
label_list
,
x
=
''
,
y
=
''
,
title
=
''
,
x_label
=
''
,
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
export_as
=
'
.pdf
'
):
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
export_as
=
'
.pdf
'
,
dpi
=
500
):
print
(
'
###################################################################################################
'
)
print
(
'
Plotting:
'
+
title
)
print
(
'
---------------------------------------------------------------------------------------------------
'
)
...
...
@@ -169,19 +182,21 @@ def plot_2d_scatter_old(data_frame_list, label_list, x='', y='', title='', x_lab
plt
.
yscale
(
'
log
'
)
legend
=
ax1
.
legend
(
loc
=
'
best
'
,
numpoints
=
1
,
frameon
=
True
,
framealpha
=
1.0
)
legend
.
get_frame
().
set_facecolor
(
'
white
'
)
plt
.
title
(
title
)
fig
.
suptitle
(
title
,
fontsize
=
12
)
fig
.
set_size_inches
(
8
,
4.5
)
if
show_plot
:
plt
.
show
()
if
save_plot
:
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
)
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
,
dpi
=
dpi
)
plt
.
close
()
return
def
plot_2d_kde
(
data_frame
,
x
=
''
,
y
=
''
,
title
=
''
,
x_label
=
''
,
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
style
=
'
kde
'
,
export_as
=
'
.pdf
'
):
save_plot
=
True
,
style
=
'
kde
'
,
export_as
=
'
.pdf
'
,
dpi
=
500
):
print
(
'
###################################################################################################
'
)
print
(
'
Plotting:
'
+
title
)
print
(
'
---------------------------------------------------------------------------------------------------
'
)
...
...
@@ -204,14 +219,14 @@ def plot_2d_kde(data_frame, x='', y='', title='', x_label='', y_label='', x_log=
if
show_plot
:
plt
.
show
()
if
save_plot
:
sns_plot
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
)
sns_plot
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
,
dpi
=
dpi
)
plt
.
close
()
return
def
plot_2d_matrix
(
data_frame
,
x
=
''
,
y
=
''
,
title
=
''
,
x_label
=
''
,
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
export_as
=
'
.pdf
'
):
save_plot
=
True
,
export_as
=
'
.pdf
'
,
dpi
=
500
):
print
(
'
###################################################################################################
'
)
print
(
'
Plotting:
'
+
title
)
print
(
'
---------------------------------------------------------------------------------------------------
'
)
...
...
@@ -242,14 +257,14 @@ def plot_2d_matrix(data_frame, x='', y='', title='', x_label='', y_label='', x_l
if
show_plot
:
plt
.
show
()
if
save_plot
:
sns_plot
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
'
_matrix.
png
'
)
sns_plot
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
'
_matrix.
'
+
export_as
,
dpi
=
dpi
)
plt
.
close
()
return
def
plot_2d_scatter
(
data_frame_list
,
label_list
,
x
=
''
,
y
=
''
,
title
=
''
,
x_label
=
''
,
y_label
=
''
,
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
export_as
=
'
.pdf
'
):
x_log
=
False
,
y_log
=
False
,
show_plot
=
True
,
save_plot
=
True
,
export_as
=
'
.pdf
'
,
dpi
=
500
):
print
(
'
###################################################################################################
'
)
print
(
'
Plotting:
'
+
title
)
print
(
'
---------------------------------------------------------------------------------------------------
'
)
...
...
@@ -362,12 +377,27 @@ def plot_2d_scatter(data_frame_list, label_list, x='', y='', title='', x_label='
ax1
.
yscale
(
'
log
'
)
legend
=
ax1
.
legend
(
loc
=
'
best
'
,
numpoints
=
1
,
frameon
=
True
,
framealpha
=
1.0
)
legend
.
get_frame
().
set_facecolor
(
'
white
'
)
# play with this factor ot ensure a better design, as well as the distance_between_ax1_ax3
shrink_factor
=
0.75
distance_between_ax1_ax3
=
1.1
box1
=
ax1
.
get_position
()
ax1
.
set_position
([
box1
.
x0
,
box1
.
y0
,
box1
.
width
*
shrink_factor
,
box1
.
height
])
box2
=
ax2
.
get_position
()
ax2
.
set_position
([
box2
.
x0
,
box2
.
y0
,
box2
.
width
*
shrink_factor
,
box2
.
height
])
box3
=
ax3
.
get_position
()
ax3
.
set_position
([
box3
.
x0
-
box1
.
width
*
(
1
-
shrink_factor
),
box3
.
y0
,
box3
.
width
*
shrink_factor
,
box3
.
height
])
legend
=
ax1
.
legend
(
loc
=
'
center left
'
,
framealpha
=
1.0
,
numpoints
=
1
,
frameon
=
True
,
bbox_to_anchor
=
((
distance_between_ax1_ax3
+
box1
.
width
)
*
shrink_factor
,
0.5
))
legend
.
get_frame
().
set_facecolor
(
'
white
'
)
fig
.
suptitle
(
title
,
fontsize
=
12
)
fig
.
set_size_inches
(
8
,
4.5
)
if
show_plot
:
plt
.
show
()
if
save_plot
:
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
)
fig
.
savefig
(
'
plots/
'
+
title
.
replace
(
'
'
,
'
_
'
)
+
export_as
,
dpi
=
dpi
)
plt
.
close
()
return
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