import matplotlib.pyplot as plt def plot_timespace_efficiency(limits, results): """It plots the time and space efficiency of multiple configurations""" plt.figure(figsize=(12, 6)) print(len(limits), results) plt.subplot(1, 2, 1) for func in results: plt.plot(limits, results[func]['time'], label=func) plt.xlabel('Limit') plt.ylabel('Time (seconds)') plt.xscale('log') plt.yscale('log') plt.legend() plt.title('Time Efficiency') plt.subplot(1, 2, 2) for func in results: plt.plot(limits, results[func]['space'], label=func) plt.xlabel('Limit') plt.ylabel('Space (MiB)') plt.xscale('log') plt.yscale('log') plt.legend() plt.title('Space Efficiency') plt.tight_layout() plt.show()