import numpy as np import matplotlib.pyplot as plt import prettyplotlib as ppl import matplottheme as mpt import math x = np.arange(-math.pi,math.pi, 0.1) fig = plt.figure(figsize=(8,6)) plt.plot(x, np.sin(x), label="sin(x)") plt.plot(x, np.cos(x), label="cos(x)") plt.plot(x, -np.sin(x), label="-sin(x)") plt.plot(x, -np.cos(x), label="-cos(x)") plt.legend(loc="best") fig = plt.figure(figsize=(8,6)) ppl.plot(x, np.sin(x), label="sin(x)") ppl.plot(x, np.cos(x), label="cos(x)") ppl.plot(x, -np.sin(x), label="-sin(x)") ppl.plot(x, -np.cos(x), label="-cos(x)") ppl.legend(loc="best") mpt.set_theme("ggplot2", "ggplot2") fig = plt.figure(figsize=(8,6)) ax = fig.add_subplot(111) mpt.plot(ax, x, np.sin(x), label="sin(x)") mpt.plot(ax, x, np.cos(x), label="cos(x)") mpt.plot(ax, x, -np.sin(x), label="-sin(x)") mpt.plot(ax, x, -np.cos(x), label="-cos(x)") mpt.legend(ax, loc="best") from IPython.display import set_matplotlib_formats set_matplotlib_formats('svg') fig = plt.figure(figsize=(12,9)) plt.plot(x, np.sin(x), label="sin(x)") plt.plot(x, np.cos(x), label="cos(x)") plt.plot(x, -np.sin(x), label="-sin(x)") plt.plot(x, -np.cos(x), label="-cos(x)") plt.legend(loc="best")