*Plot a dictionary of numpy lightcurves polynomials*

    **Key Arguments:**
        - ``log`` -- logger
        - ``title`` -- title for the plot
        - ``polynomialDict`` -- dictionary of polynomials { label01 : poly01, label02 : poly02 }
        - ``orginalDataDictionary`` -- the orginal data points {name: [x, y]}
        - ``pathToOutputPlotsFolder`` -- path the the output folder to save plot to
        - ``xRange`` -- the x-range for the polynomial [xmin, xmax, interval]
        - ``xlabel`` -- xlabel
        - ``ylabel`` -- ylabel
        - ``xAxisLimits`` -- the x-limits for the axes [xmin, xmax]
        - ``yAxisLimits`` -- the y-limits for the axes [ymin, ymax]
        - ``yAxisInvert`` -- invert the y-axis? Useful for lightcurves
        - ``prependNum`` -- prepend this number to the output filename
        - ``legend`` -- plot a legend?

    **Return:**
        - None

def plot_polynomial(
        log,
        title,
        polynomialDict,
        orginalDataDictionary=False,
        pathToOutputPlotsFolder="~/Desktop",
        xRange=False,
        xlabel=False,
        ylabel=False,
        xAxisLimits=False,
        yAxisLimits=False,
        yAxisInvert=False,
        prependNum=False,
        legend=False):
    """
    *Plot a dictionary of numpy lightcurves polynomials*

    **Key Arguments:**
        - ``log`` -- logger
        - ``title`` -- title for the plot
        - ``polynomialDict`` -- dictionary of polynomials { label01 : poly01, label02 : poly02 }
        - ``orginalDataDictionary`` -- the orginal data points {name: [x, y]}
        - ``pathToOutputPlotsFolder`` -- path the the output folder to save plot to
        - ``xRange`` -- the x-range for the polynomial [xmin, xmax, interval]
        - ``xlabel`` -- xlabel
        - ``ylabel`` -- ylabel
        - ``xAxisLimits`` -- the x-limits for the axes [xmin, xmax]
        - ``yAxisLimits`` -- the y-limits for the axes [ymin, ymax]
        - ``yAxisInvert`` -- invert the y-axis? Useful for lightcurves
        - ``prependNum`` -- prepend this number to the output filename
        - ``legend`` -- plot a legend?

    **Return:**
        - None
    """
    ################ > IMPORTS ################
    ## STANDARD LIB ##
    import sys
    ## THIRD PARTY ##
    import matplotlib.pyplot as plt
    import numpy as np
    ## LOCAL APPLICATION ##

    ################ >ACTION(S) ################
    colors = {
        'green': '#859900',
        'blue': '#268bd2',
        'red': '#dc322f',
        'gray': '#D2D1D1',
        'orange': '#cb4b16',
        'violet': '#6c71c4',
        'cyan': '#2aa198',
        'magenta': '#d33682',
        'yellow': '#b58900'
    }

    if not xRange:
        log.error('please provide an x-range')
        sys.exit(1)

    ax = plt.subplot(111)

    if len(xRange) == 2:
        x = np.arange(xRange[0] * 4, xRange[1] * 4, 1)
        x = x / 4.
    else:
        x = np.arange(xRange[0], xRange[1], xRange[2])

    if xAxisLimits:
        ax.set_xlim(xAxisLimits[0], xAxisLimits[1])
    else:
        overShoot = (xRange[1] - xRange[0]) / 10.
        ax.set_xlim(xRange[0] - overShoot, xRange[1] + overShoot)
    if yAxisLimits:
        ax.set_ylim(yAxisLimits[0], yAxisLimits[1])

    theseColors = [colors['blue'], colors[
        'green'], colors['red'], colors['violet']]

    count = 0
    if orginalDataDictionary:
        for name, data in orginalDataDictionary.iteritems():
            ax.plot(data[0], data[1], '.', label=name,
                    color=theseColors[count])
            count += 1
            if count == 4:
                count = 0

    count = 0
    for snType, poly in polynomialDict.iteritems():
        log.debug('x: %s' % (x,))
        ax.plot(x, poly(x), label='%s' % (snType,), color=theseColors[count])
        count += 1
        if count == 4:
            count = 0

    # Shink current axis by 20%
    box = ax.get_position()
    ax.set_position([box.x0, box.y0, box.width * 0.8, box.height])
    # Put a legend to the right of the current axis
    if legend:
        ax.legend(loc='center left', bbox_to_anchor=(1, 0.5), prop={'size': 8})
    ax.titlesize = 'medium'   # fontsize of the axes title
    ax.labelsize = 'medium'  # fontsize of the x any y labels

    if xlabel:
        plt.xlabel(xlabel, fontsize='small')
    if ylabel:
        plt.ylabel(ylabel, fontsize='small')
    if title:
        plt.title(title, fontsize='small',
                  verticalalignment='bottom', linespacing=0.2)

    if yAxisInvert:
        ax.invert_yaxis()

    # fileName = pathToOutputPlotsFolder + title.replace(" ", "_") + ".ps"
    # plt.savefig(fileName)
    if prependNum:
        title = "%02d_%s" % (prependNum, title)
    thisTitle = title.replace(" ", "_")
    thisTitle = thisTitle.replace("-", "_")
    fileName = pathToOutputPlotsFolder + thisTitle + ".png"
    imageLink = """
![%s_plot](%s)

""" % (thisTitle, fileName)
    plt.savefig(fileName)
    plt.clf()  # clear figure

    return imageLink