import os import numpy as np import matplotlib.pyplot as plt # IO: This loads the timings for you 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)) threads = np.array(threads) timings = np.array(timings) timings /= timings[np.where(threads == 1)[0][0]] print('This is the data I loaded: threads =', threads, ', timings =',timings) fig, axs = plt.subplots() # Remember to label your axis # Feel free to make it pretty axs.plot(threads, timings, '*') axs.set_xlabel('number of threads') axs.set_ylabel('relative processing time to single threading') plt.savefig('threads_v_relative_timings.png', dpi=300)