Creates the scree plot.

    :param data: the eigenvalues.
    :param o_filename: the name of the output files.
    :param options: the options.

    :type data: numpy.ndarray
    :type o_filename: str
    :type options: argparse.Namespace

def create_scree_plot(data, o_filename, options):
    """Creates the scree plot.

    :param data: the eigenvalues.
    :param o_filename: the name of the output files.
    :param options: the options.

    :type data: numpy.ndarray
    :type o_filename: str
    :type options: argparse.Namespace

    """
    # Importing plt
    mpl.use("Agg")
    import matplotlib.pyplot as plt
    plt.ioff()

    # Computing the cumulative sum
    cumul_data = np.cumsum(data)

    # Creating the figure and axes
    fig, axes = plt.subplots(2, 1, figsize=(8, 16))

    # The title of the figure
    fig.suptitle(options.scree_plot_title, fontsize=16, weight="bold")

    fig.subplots_adjust(hspace=0.27, top=0.93, bottom=0.06)

    # Modifying the spines
    for axe in axes:
        axe.xaxis.set_ticks_position("bottom")
        axe.yaxis.set_ticks_position("left")
        axe.spines["top"].set_visible(False)
        axe.spines["right"].set_visible(False)
        axe.spines["left"].set_position(("outward", 9))
        axe.spines["bottom"].set_position(("outward", 9))

    # First, plotting the eigenvalues
    axes[0].set_title("Scree Plot", weight="bold")
    axes[0].set_xlabel("Component")
    axes[0].set_ylabel("Eigenvalue")
    axes[0].plot(np.arange(len(data)) + 1, data, marker="o", c="#0099CC",
                 mec="#0099CC", ls="-", lw=2, clip_on=False)

    # Then, plotting the annotation
    for i in range(len(data)):
        axes[0].annotate(np.round(data[i], 3),
                         xy=(np.arange(len(data))[i] + 1, data[i]),
                         xytext=(1, 10), textcoords="offset points",
                         ha="left", va="bottom",
                         bbox=dict(boxstyle="round,pad=0.5", fc="#FFFFFF"))

    # Next plot the cumulative values
    axes[1].set_title(("Cumulative explained variance "
                       "(max={:.3f})".format(np.sum(data))), weight="bold")
    axes[1].set_xlabel("Component")
    axes[1].set_ylabel("Cumulative explained variance")
    axes[1].axhline(np.sum(data) * 0.8, ls="--", lw="2", c="#999999")
    axes[1].plot(np.arange(len(data)) + 1, cumul_data, marker="o", c="#CC0000",
                 mec="#CC0000", mfc="#CC0000", ls="-", lw=2, clip_on=False)

    # Then, plotting the annotation
    for i in range(len(data)):
        axes[1].annotate(np.round(cumul_data[i], 3),
                         xy=(np.arange(len(data))[i] + 1, cumul_data[i]),
                         xytext=(1, -10), textcoords="offset points",
                         ha="left", va="top",
                         bbox=dict(boxstyle="round,pad=0.5", fc="#FFFFFF"))

    # Saving the file
    plt.savefig(o_filename, dpi=300)
    plt.close(fig)