add code for best plot eva
This commit is contained in:
parent
f2e462842e
commit
c694a89979
|
@ -7,6 +7,7 @@ threads, timings = [], []
|
|||
for file in os.listdir('timings'):
|
||||
with open(f'timings/{file}', 'r') as f:
|
||||
n, t = f.read().strip().split(',')
|
||||
if n != 'None':
|
||||
threads.append(int(n))
|
||||
timings.append(float(t))
|
||||
threads = np.array(threads)
|
||||
|
@ -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)
|
||||
|
|
BIN
exercises/exerciseA/threads_v_timings.png
Normal file
BIN
exercises/exerciseA/threads_v_timings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Loading…
Reference in a new issue