def create_dict_organising_subplots(n_plots_per_fig, n_rows):
    """
    Function to help organise the creation of figures that contain multiple plots.

    Parameters
    ----------
    n_plots_per_fig : int
        Number of plots per figure in total
    n_rows : int
        Number of rows of plots per figure

    Notes
    -----
    For example, 15 histograms printed in figures with 8 histograms per figure/page.
    Returns a dict that gives a tuple for each plot/graph.
    newfig, savefig, fig_nr, plot_nr_in_fig, r, c
    r and c are used to index pyplot subplots as follows
    fig, axarr = plt.subplots(2,2)
    plotcontainer = axarr[r,c].plot(x, y)
    """
    dict_organising_subplots = {}
    fig_nr = 0
    plot_nr_in_fig = 0
    r = 0
    c = 0
    savefig = False
    newfig = True
    for plotnr in range(1, 500):
        dict_organising_subplots[plotnr
            ] = newfig, savefig, fig_nr, plot_nr_in_fig, r, c
        plot_nr_in_fig += 1
        r += 1
        newfig = False
        savefig = False
        if plot_nr_in_fig % (n_plots_per_fig - 1) == 0 and plot_nr_in_fig != 0:
            savefig = True
        if plot_nr_in_fig % n_rows == 0 and plot_nr_in_fig != 0:
            c += 1
            r = 0
        if plotnr % n_plots_per_fig == 0 and plotnr != 0:
            fig_nr += 1
            plot_nr_in_fig = 0
            r = 0
            c = 0
            newfig = True
    return dict_organising_subplots
