diff --git a/exercises/exerciseA/plot.py b/exercises/exerciseA/plot.py index 4130224..8c30407 100644 --- a/exercises/exerciseA/plot.py +++ b/exercises/exerciseA/plot.py @@ -7,8 +7,9 @@ threads, timings = [], [] for file in os.listdir('timings'): with open(f'timings/{file}', 'r') as f: n, t = f.read().strip().split(',') - threads.append(int(n)) - timings.append(float(t)) + if n != 'None': + threads.append(int(n)) + timings.append(float(t)) threads = np.array(threads) timings = np.array(timings) @@ -16,8 +17,9 @@ print('This is the data I loaded: threads =', threads, ', timings =',timings) fig, axs = plt.subplots() -# CREATE YOUR PLOT HERE -# Remember to label your axis -# Feel free to make it pretty +axs.scatter(x=threads, y=timings, color = 'hotpink', marker = '*') +axs.set_xlabel('Number of threads') +axs.set_ylabel('Timing [s]') +axs.grid() -plt.savefig('threads_v_timings.png', dpi=300) +plt.savefig('threads_v_timings', dpi=300) diff --git a/exercises/exerciseA/threads_v_timings.png b/exercises/exerciseA/threads_v_timings.png new file mode 100644 index 0000000..ef895d1 Binary files /dev/null and b/exercises/exerciseA/threads_v_timings.png differ