Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DetectorWriteSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
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
EWMSCP
DetectorWriteSim
Commits
73ea73aa
Commit
73ea73aa
authored
1 year ago
by
Michael Reuscher
Browse files
Options
Downloads
Patches
Plain Diff
DESY_logo for Plots
parent
78a5ff61
No related branches found
No related tags found
1 merge request
!4
Python driver and data analysis part
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
visualizer/setup.py
+1
-0
1 addition, 0 deletions
visualizer/setup.py
visualizer/visualizer/SeabornPlotter.py
+20
-12
20 additions, 12 deletions
visualizer/visualizer/SeabornPlotter.py
visualizer/visualizer/desy_logo.png
+0
-0
0 additions, 0 deletions
visualizer/visualizer/desy_logo.png
with
21 additions
and
12 deletions
visualizer/setup.py
+
1
−
0
View file @
73ea73aa
...
...
@@ -5,6 +5,7 @@ setup(
version
=
'
1.0
'
,
description
=
'
visualizer for detector-sim
'
,
author
=
'
Michael Reuscher
'
,
package_data
=
{
''
:
[
'
desy_logo.png
'
]},
packages
=
find_packages
(),
install_requires
=
[
'
numpy
'
,
...
...
This diff is collapsed.
Click to expand it.
visualizer/visualizer/SeabornPlotter.py
+
20
−
12
View file @
73ea73aa
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
seaborn
as
sns
from
matplotlib.offsetbox
import
OffsetImage
,
AnnotationBbox
import
os
import
pandas
as
pd
sns
.
set_theme
()
...
...
@@ -12,39 +14,45 @@ class SeabornPlotter:
self
.
name
=
name
self
.
current_plot
=
None
def
configure_plot
(
self
,
ax
):
if
self
.
name
==
"
idle
"
or
self
.
name
==
"
wait
"
:
ax
.
set_yscale
(
'
symlog
'
,
linthresh
=
0.1
)
else
:
ax
.
set_yscale
(
'
log
'
)
def
plot
(
self
):
df
=
self
.
dataframe
x
=
df
[
'
size
'
]
y
=
df
[
'
duration
'
]
title
=
"
Procedure: {}
"
.
format
(
self
.
name
)
# Bin Grenzen festlegen
n
=
df
[
'
size
'
].
nunique
()
bins_x
=
np
.
zeros
(
n
+
1
,
dtype
=
np
.
float64
)
bins_x
[
0
]
=
0.75
*
(
1
<<
4
)
for
i
in
range
(
1
,
n
+
1
):
bins_x
[
i
]
=
bins_x
[
i
-
1
]
*
2
print
(
bins_x
)
bins_y
=
np
.
logspace
(
-
6
,
0
,
num
=
101
)
# Achsen und Plot definieren
f
,
ax
=
plt
.
subplots
(
figsize
=
(
16
,
9
))
sns
.
histplot
(
x
=
x
,
y
=
y
,
color
=
"
blue
"
,
bins
=
[
bins_x
,
bins_y
],)
# Anpassung der Achsenbeschriftungen und des Titels
ax
.
set_xlabel
(
"
Data size [Bytes]
"
)
ax
.
set_ylabel
(
"
Time/Event [s]
"
)
plt
.
title
(
title
)
# Setze die Skala der x-Achse auf logarithmisch
ax
.
set_xscale
(
'
log
'
)
ax
.
set_yscale
(
'
log
'
)
# Setze die Beschriftungen
ax
.
set_xlabel
(
"
Data size [Bytes]
"
)
ax
.
set_ylabel
(
"
Time/Event [s]
"
)
plt
.
title
(
title
)
plt
.
grid
(
True
)
plt
.
xticks
(
rotation
=
45
)
current_directory
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
logo_path
=
os
.
path
.
join
(
current_directory
,
"
desy_logo.png
"
)
logo_img
=
plt
.
imread
(
logo_path
)
logo_size
=
0.15
logo_x
=
1.065
logo_y
=
1.04
imagebox
=
OffsetImage
(
logo_img
,
zoom
=
logo_size
)
ab
=
AnnotationBbox
(
imagebox
,
(
logo_x
,
logo_y
),
xycoords
=
'
axes fraction
'
,
frameon
=
False
)
plt
.
gca
().
add_artist
(
ab
)
# Speichern und Anzeigen
plt
.
savefig
(
title
+
"
.svg
"
,
format
=
'
svg
'
)
plt
.
show
()
...
...
This diff is collapsed.
Click to expand it.
visualizer/visualizer/desy_logo.png
0 → 100755
+
0
−
0
View file @
73ea73aa
23.9 KiB
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