Skip to content
Snippets Groups Projects
Commit c0073147 authored by Daniel Meißner's avatar Daniel Meißner Committed by Daniel Meißner
Browse files

scripts: added script to plot data

parent fbd7699a
No related branches found
No related tags found
No related merge requests found
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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment