# python3 time-complexity-log.py import matplotlib.pyplot as plt import numpy as np import scipy.special as sp import math #plt.rcParams["text.usetex"] = True x = np.linspace(0.0000001, 10, 1001) plt.xticks(np.linspace(0, 10, 11)) plt.ylim(0.001, 10000) plt.yscale('log') y = np.log2(x) plt.plot(x, y, "c", label="$log_2(x)$") # # add your codes here for other functions # y = sp.factorial(x) plt.plot(x, y, label="$x!$") plt.legend(bbox_to_anchor=(0.993, 0.01), loc='lower right', borderaxespad=0, fontsize=10, fancybox=True, framealpha=0.0) plt.savefig("time-complexity-log.pdf", transparent=True, bbox_inches = 'tight', pad_inches = 0)