from pathlib import Path import matplotlib import matplotlib.pyplot as plt plt.style.use(["ggplot", "report-theme.mplstyle"]) months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] website = [38, 45, 49, 54, 58, 63] mobile = [22, 27, 31, 33, 40, 44] fig, ax = plt.subplots(layout="constrained") ax.plot(months, website, marker="o", label="Website") ax.plot(months, mobile, marker="s", label="Mobile") ax.set_title("Monthly signups by channel") ax.set_xlabel("Month") ax.set_ylabel("Signups") ax.legend() output = Path("style-theme-set.png") fig.savefig(output, dpi=160) plt.close(fig) print(f"matplotlib {matplotlib.__version__} ({matplotlib.get_backend()} backend)") print("styles applied: ggplot + report-theme.mplstyle") print(f"axes facecolor: {plt.rcParams['axes.facecolor']}") print(f"grid enabled: {plt.rcParams['axes.grid']}") print(f"line width: {plt.rcParams['lines.linewidth']}") print(f"saved: {output}") print(f"bytes: {output.stat().st_size}")