コード例 #1
0
            xticks = np.arange(0,365,50)
            xticklabels = [ str2tex(str(ii), usetex=usetex) for ii in xticks ]
        else:
            xlabel = str2tex('',usetex=usetex)
            xticks = np.arange(0,365,50)
            xticklabels = [ str2tex('', usetex=usetex) for ii in xticks ]
            
        yticks      = np.arange((all_cat_ttime[icategorizer][ibasin][0,0].year-all_cat_ttime[icategorizer][ibasin][0,0].year%10+10)-all_cat_ttime[icategorizer][ibasin][0,0].year,nyears,10)
        yticklabels = [ str2tex(str(ii+all_cat_ttime[icategorizer][ibasin][0,0].year), usetex=usetex) for ii in yticks ]
        ylabel = str2tex('Year',usetex=usetex)

        plt.setp(sub, xlabel=xlabel, xticks=xticks, xticklabels=xticklabels)
        plt.setp(sub, ylabel=ylabel, yticks=yticks, yticklabels=yticklabels)

        # numbering of subplots
        abc2plot(sub, dxabc, dyabc, iplot, lower=False, bold=True, va='top', ha='right', usetex=usetex, mathrm=True, parenthesis='none')      

        # plot variables that are changed for different recipes
        recipe_names = all_cat_recipe_info[icategorizer][0]
        recipe_vars  = all_cat_recipe_info[icategorizer][1]

        # determine on how much to shift color bar up
        cticks = cvals      
        dy = -0.5
        for irecipe,recipe_cat in enumerate(recipes[icategorizer]):

            # skip if this recipe is renames with None
            if ( categorizer_name == 'categorize_meteo_decision_tree_expert'):
                if rename_recipes_expert[recipe_cat] is None:
                    continue
                else:
コード例 #2
0
                         horizontalalignment='center',
                         transform=sub.transAxes)
                plt.xlabel(
                    str2tex("Number of Sobol' Reference Sets $K$",
                            usetex=usetex))
                if iplot % 2 == 1:
                    plt.ylabel(
                        str2tex("$ST_{i}^{(appr)} - ST_{i}^{(theo)}$",
                                usetex=usetex))
                else:
                    plt.ylabel(str2tex("", usetex=usetex))
                abc2plot(sub,
                         dxabc,
                         dyabc,
                         iplot,
                         bold=True,
                         usetex=usetex,
                         mathrm=True,
                         large=True,
                         parenthesis='none',
                         verticalalignment='top')
                #plt.title(str2tex("Main Sobol' Index $S_i$",usetex=usetex))

            elif method == 'xSSA':

                nsets = np.sort(list(map(int, numerical_results.keys())))

                si_numerical = np.array([
                    numerical_results[str(iset)]['processes']['si']['out']
                    for iset in nsets
                ])
                sti_numerical = np.array([
コード例 #3
0
if doabc:

    #  [left, bottom, width, height]
    lsub = fig.add_axes(
        [pos[0] - 0.36, pos[1] + pos[3] - 0.01, pos[2] - 0.01, pos[3]])

    lsub.set_xlim([0, 1])
    lsub.set_ylim([0, 1])

    # subplot numbering
    abc2plot(lsub,
             dxabc,
             dyabc,
             iplot,
             lower=False,
             bold=True,
             large=True,
             mathrm=True,
             usetex=usetex,
             horizontalalignment='left',
             verticalalignment='bottom')

    lsub.set_title('')
    lsub.set_xlabel('')
    lsub.set_ylabel('')
    lsub.set_xticks([])
    lsub.set_yticks([])
    lsub.set_axis_off()

# -----------------------------------------
# Subcatchments of Saguenay-Lac-St-Jean region - highlight only 4 head catchments with labels
コード例 #4
0
ファイル: figure_3.py プロジェクト: julemai/EEE-DA
    years = mdates.YearLocator()  # every year
    months = mdates.MonthLocator()  # every month
    years_fmt = mdates.DateFormatter('%Y')

    sub.xaxis.set_major_locator(years)
    sub.xaxis.set_major_formatter(years_fmt)
    sub.xaxis.set_minor_locator(months)
    date_form = DateFormatter("%Y")
    sub.xaxis.set_major_formatter(date_form)

    abc2plot(sub,
             dxabc,
             dyabc,
             iplot,
             bold=True,
             usetex=usetex,
             mathrm=True,
             large=True,
             parenthesis='none',
             horizontalalignment='left',
             verticalalignment='top',
             zorder=400)

if (outtype == 'pdf'):
    pdf_pages.savefig(fig)
    plt.close(fig)
elif (outtype == 'png'):
    pngfile = pngbase + "{0:04d}".format(ifig) + ".png"
    fig.savefig(pngfile,
                transparent=transparent,
                bbox_inches=bbox_inches,
                pad_inches=pad_inches)