Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
su
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
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
dmeiss2s
su
Commits
c0073147
Commit
c0073147
authored
9 years ago
by
Daniel Meißner
Committed by
Daniel Meißner
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
scripts: added script to plot data
parent
fbd7699a
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
gr_grc/scripts/plot_data.py
+39
-0
39 additions, 0 deletions
gr_grc/scripts/plot_data.py
with
39 additions
and
0 deletions
gr_grc/scripts/plot_data.py
0 → 100644
+
39
−
0
View file @
c0073147
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
yaml
import
sys
# http://mple.m-artwork.eu/home/posts?offset=10
if
len
(
sys
.
argv
)
!=
2
:
print
(
"
Usage:
"
+
sys
.
argv
[
0
]
+
"
/path/to/data.yml
"
)
sys
.
exit
(
1
)
data
=
None
with
open
(
sys
.
argv
[
1
],
'
r
'
)
as
stream
:
data
=
yaml
.
load
(
stream
)
fig
,
ax
=
plt
.
subplots
()
x
=
np
.
arange
(
0
,
101
,
1
)
values
=
[]
for
i
,
var
in
enumerate
(
data
[
'
signal_blocks
'
]):
values
.
append
(
var
[
'
real_transmission_time
'
])
ax
.
plot
(
i
+
1
,
var
[
'
real_transmission_time
'
],
linestyle
=
"
None
"
,
marker
=
"
.
"
,
color
=
"
red
"
)
y_mean
=
[
np
.
mean
(
values
)
for
i
in
x
]
y_med
=
[
np
.
median
(
values
)
for
i
in
x
]
print
(
y_mean
)
print
(
y_med
)
mean_line
=
ax
.
plot
(
x
,
y_mean
,
label
=
'
Mittwelwert
\t
'
+
str
(
round
(
y_mean
[
0
],
2
))
+
'
ms
'
,
linestyle
=
'
--
'
)
mean_line
=
ax
.
plot
(
x
,
y_med
,
label
=
'
Median
\t
'
+
str
(
round
(
y_med
[
0
],
2
))
+
'
ms
'
,
linestyle
=
'
-
'
)
legend
=
ax
.
legend
(
loc
=
'
upper right
'
)
plt
.
xlabel
(
"
Versuch
"
)
plt
.
ylabel
(
"
Frequenzbelegungszeit [ms]
"
)
plt
.
title
(
data
[
'
tag
'
])
plt
.
show
()
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