def maybe_get_ax(*args, **kwargs):

    if 'ax' in kwargs:
        ax = kwargs.pop('ax')
    elif len(args) == 0:
        fig = plt.gcf()
        ax = plt.gca()
    elif isinstance(args[0], mpl.axes.Axes):
        ax = args[0]
        args = args[1:]
    else:
        ax = plt.gca()
    return ax, args, dict(kwargs)
It used to be that the first argument of prettyplotlib had to be the 'ax'
dataset/ETHPy150Open olgabot/prettyplotlib/prettyplotlib/utils.py/maybe_get_ax