@@ -0,0 +1,1393 @@
+%22%22%22Utilities to work with plots.%22%22%22%0A%0Aimport matplotlib.pyplot as plt%0A%0A%0A# Colors for Plots%0ACOLORS = %5B(31, 119, 180),  (174, 199, 232), (255, 127, 14),  (255, 187, 120),%0A          (44, 160, 44),   (152, 223, 138), (214, 39, 40),   (255, 152, 150),%0A          (148, 103, 189), (197, 176, 213), (140, 86, 75),   (196, 156, 148),%0A          (227, 119, 194), (247, 182, 210), (127, 127, 127), (199, 199, 199),%0A          (188, 189, 34),  (219, 219, 141), (23, 190, 207),  (158, 218, 229)%5D%0A%0Afor i in range(len(COLORS)):%0A    r, g, b = COLORS%5Bi%5D%0A    COLORS%5Bi%5D = (r / 255., g / 255., b / 255.)%0A%0A%0Adef subplots(nrows=1, ncols=1, figsize=None, xlabel=None, ylabel=None):%0A    plt.rc(%22font%22, size=20)%0A    pre, axs = plt.subplots(nrows=nrows, ncols=ncols, figsize=figsize)%0A%0A    all_axs = %5Baxs%5D if nrows * ncols == 1 else axs%0A    for ax in all_axs:%0A        ax.set_xlabel(xlabel)%0A        ax.set_ylabel(ylabel)%0A        ax.grid(axis=%22y%22, linewidth=.2)%0A        ax.spines%5B%22top%22%5D.set_visible(False)%0A        ax.spines%5B%22bottom%22%5D.set_visible(False)%0A        ax.spines%5B%22right%22%5D.set_visible(False)%0A        ax.spines%5B%22left%22%5D.set_visible(False)%0A        ax.color_nr = 0%0A%0A    return pre, axs%0A%0A%0Adef plot(ax, x, y, label=None, color=None):%0A    if color is None:%0A        color = COLORS%5Bax.color_nr%5D%0A        ax.color_nr += 1%0A    elif isinstance(color, int):%0A        color = COLORS%5Bcolor%5D%0A%0A    ax.plot(x, y, color=color, label=label)%0A

add utility functions to work with matplotlib