def add_legend(ax=None, colors=[(1, 0, 0), (0, 1, 0), (0, 0, 1)], labels=[
    's', 'p', 'd'], styles='solid', widths=0.7, anchor=(0, 1), ncol=3, loc=
    'lower left', fontsize='small', frameon=False):
    """
    - Adds custom legeneds on a given axes,returns None.
    - **Parameters**
        - ax       : Matplotlib axes.
        - colors   : List of colors.
        - labels   : List of labels.
        - styles   : str or list of line styles.
        - widths   : str or list of line widths.
        - **kwargs : Matplotlib's legend arguments.
    """
    if ax == None:
        raise ValueError('Matplotlib axes (ax) is not given.')
    else:
        import matplotlib.pyplot as plt
        from matplotlib import rc
        import matplotlib as mpl
        mpl.rcParams['font.serif'] = 'STIXGeneral'
        mpl.rcParams['font.family'] = 'serif'
        mpl.rcParams['mathtext.fontset'] = 'stix'
        if type(widths) == float or type(widths) == int:
            if type(styles) == str:
                for color, label in zip(colors, labels):
                    ax.plot([], [], color=color, lw=widths, linestyle=
                        styles, label=label)
            else:
                for color, label, style in zip(colors, labels, styles):
                    ax.plot([], [], color=color, lw=widths, linestyle=style,
                        label=label)
        elif type(styles) == str:
            for color, label, width in zip(colors, labels, widths):
                ax.plot([], [], color=color, lw=width, linestyle=styles,
                    label=label)
        else:
            for color, label, width, style in zip(colors, labels, widths,
                styles):
                ax.plot([], [], color=color, lw=width, linestyle=style,
                    label=label)
        ax.legend(fontsize=fontsize, frameon=frameon, ncol=ncol,
            bbox_to_anchor=anchor, loc=loc)
    return None
